Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Auto login

5 views
Skip to first unread message

tns1

unread,
Oct 1, 2003, 1:30:41 AM10/1/03
to
I need my system to autologin on a serial console when it boots. This
system has no password, so if I could simply pass 'root<cr>' during
boot, that would be enough. I have tried a few things, but the
inittab/getty stuff is not cooperating.
thanks

Marco Cavallini

unread,
Oct 1, 2003, 5:29:52 AM10/1/03
to

Try this, I used this successfully
http://www.linuxgazette.com/issue72/chung.html

Ciao
Marco Cavallini
==============================================
Koan s.a.s. - Software Engineering (x86 and ARM)
Linux and WinCE solutions for Embedded and Real-Time Software
Via Pascoli, 3 - 24121 Bergamo - ITALIA
Tel./Fax (++39) +35 - 255.235 - www.koansoftware.com
==============================================


tns1

unread,
Oct 1, 2003, 10:31:39 AM10/1/03
to


> Try this, I used this successfully
> http://www.linuxgazette.com/issue72/chung.html
>

Works great, thanks.

tns1

unread,
Oct 1, 2003, 12:03:17 PM10/1/03
to

So how do I execute different commands depending on where the login came
from (same user in each case)?

Ideally this would be something in .bashrc that would let me launch one
program if the login came from the serial console, and another if it was
the main console, yet another if it was an ssh login.
thanks

tns1

unread,
Oct 2, 2003, 10:24:22 PM10/2/03
to

Marco Cavallini wrote:

>>I need my system to autologin on a serial console

> Try this, I used this successfully
> http://www.linuxgazette.com/issue72/chung.html
>
It worked great until I had to add a password. Now it just asks for a
password.
The username part is still working. I don't understand since the app
note did
not mention anything about a password. Ideas?

Marco Cavallini

unread,
Oct 3, 2003, 4:34:38 AM10/3/03
to
> It worked great until I had to add a password. Now it just asks for a
> password.
> The username part is still working. I don't understand since the app
> note did
> not mention anything about a password. Ideas?

What password ? When ?
I don't understand what is you behavior.


tns1

unread,
Oct 3, 2003, 1:33:33 PM10/3/03
to

It turns out that the application note for performing an autologin works
for two different situations:

1) For a normal user account
2) For root, but only if root has no password assigned
My system originally had only the root account and no password, so the
autologin worked fine. In a simple non-networked, non-secure embedded
device this was OK.

I needed to add a password to add network and ssh support, and autologin
to root no longer worked. The fix was to create a user account and have
it autologin to the user account instead of root. Root access is still
available with su.

Marco Cavallini

unread,
Oct 3, 2003, 1:47:14 PM10/3/03
to
> 1) For a normal user account
> 2) For root, but only if root has no password assigned
> My system originally had only the root account and no password, so the
> autologin worked fine. In a simple non-networked, non-secure embedded
> device this was OK.
>
> I needed to add a password to add network and ssh support, and autologin
> to root no longer worked. The fix was to create a user account and have
> it autologin to the user account instead of root. Root access is still
> available with su.

You need to rebuild your autologon (see previous example linked in this
thread)
changing the password like the one you set into the linuxbox.

int main() {
execlp( "login", "login", "-f", "fred", 0);
}

Good luck!

Marco


Mad@Spammers

unread,
Oct 7, 2003, 12:22:12 PM10/7/03
to
tns1 <tn...@cox.net> wrote in message news:<Lpifb.46022$vj2.43707@fed1read06>...

Why don't you simply use ssh private/public key auto login feature?
That is, copy your root public key to .ssh in the target and you are
all set (see ssh man page). I use this scheme both to login and scp to
a development target. Haven't tried as root but as long as sshd is
configured to accept root login I see no reason why it shouldn't work
as well.

Regards.

tns1

unread,
Oct 7, 2003, 2:33:40 PM10/7/03
to

I don't think there is a way to do this for root. This example logs in
normal user fred without having to supply his password. Try it for root
and let me know if you were successful.

tns1

unread,
Oct 7, 2003, 2:49:20 PM10/7/03
to

>>It turns out that the application note for performing an autologin works
>>for two different situations:
>>
>>1) For a normal user account
>>2) For root, but only if root has no password assigned
>>My system originally had only the root account and no password, so the
>>autologin worked fine. In a simple non-networked, non-secure embedded
>>device this was OK.
>>
>>I needed to add a password to add network and ssh support, and autologin
>>to root no longer worked. The fix was to create a user account and have
>>it autologin to the user account instead of root. Root access is still
>>available with su.
>
>
> Why don't you simply use ssh private/public key auto login feature?
> That is, copy your root public key to .ssh in the target and you are
> all set (see ssh man page). I use this scheme both to login and scp to
> a development target. Haven't tried as root but as long as sshd is
> configured to accept root login I see no reason why it shouldn't work
> as well.

I don't think this gets me what I need. I need a secure remote login
which I can get with ssh. Its OK for the remote login to ask for a pwd,
so that part is fine. I also need the local console to autologin on
boot, and autoexecute an app with root priviledge. The only way I see
ssh helping me here is if I remove the root pwd in /etc/passwd, but
still have ssh require authentication. I will not be logging in from the
same remote every time, if that makes a difference.

Another possibility is if only certain users are allowed to do remote
login. Is this possible?

John Williams

unread,
Oct 7, 2003, 6:29:45 PM10/7/03
to
tns1 wrote:


> I also need the local console to autologin on
> boot, and autoexecute an app with root priviledge.

Why not just specify the app in your /etc/rc script, and have it
automatically executed that way?

tns1

unread,
Oct 7, 2003, 9:16:32 PM10/7/03
to

This is what I originally tried, and may have to revisit it since I have
pretty much exhausted my other options. The app needs to output to the
local console, and it needs to provide an interactive menu if a user
happens to be present. The autologin,autoexecute seems necessary to make
this part happen. If I simply start the app as you say, the local
console cannot interact with it, since it was not launched from there.
Without root priviledge, the local console cannot stop and restart the
app either.

What seemed so simple is proving to be a real challenge. It seems the
only way to give a normal user the necessary rights is to change the UID
to 0, but once that is done autologin wont work. Linux security is too
smart for this app!

Marco Cavallini

unread,
Oct 8, 2003, 4:20:47 AM10/8/03
to
> I don't think there is a way to do this for root. This example logs in
> normal user fred without having to supply his password. Try it for root
> and let me know if you were successful.

Actually I am using the following source code (my root user has no
password).

int main()
{
execlp( "login", "login", "-f", "root", 0);
}

Ciao
Marco

tns1

unread,
Oct 8, 2003, 1:46:39 PM10/8/03
to

>> Why don't you simply use ssh private/public key auto login feature?
>> That is, copy your root public key to .ssh in the target and you are
>> all set (see ssh man page). I use this scheme both to login and scp to
>> a development target. Haven't tried as root but as long as sshd is
>> configured to accept root login I see no reason why it shouldn't work
>> as well.
>
>
> I don't think this gets me what I need. I need a secure remote login
> which I can get with ssh. Its OK for the remote login to ask for a pwd,
> so that part is fine. I also need the local console to autologin on
> boot, and autoexecute an app with root priviledge. The only way I see
> ssh helping me here is if I remove the root pwd in /etc/passwd, but
> still have ssh require authentication. I will not be logging in from the
> same remote every time, if that makes a difference.
>
> Another possibility is if only certain users are allowed to do remote
> login. Is this possible?
>
I see now that is it possible to prevent root login in sshd_config.
Thats allows me to remove the root pwd.

tns1

unread,
Oct 8, 2003, 1:47:23 PM10/8/03
to
Here is what I am using for now:
root has no pwd. ssh is set to prevent root login in sshd_config. I can now
use the local autologin to root and autoexecute my app, or to a user who
can
su to root without a pwd and autoexecute my app. Not ideal but does satisfy
the reqs. As long as the lan is secure thats all I need.

ba...@nowant.spam.stoch.com

unread,
Jul 15, 2004, 8:03:03 PM7/15/04
to
In article <OzJgb.54013$vj2.9380@fed1read06>, tns1 wrote:
>
>
>
>>
>> Why not just specify the app in your /etc/rc script, and have it
>> automatically executed that way?
>>
> This is what I originally tried, and may have to revisit it since I have
> pretty much exhausted my other options. The app needs to output to the
> local console, and it needs to provide an interactive menu if a user
> happens to be present.

<snip>

Excuse me if I'm missing the point, but why not just specify the app
in /etc/inittab and specify it to point to the serial port?

After all...how do you think that pesky 'login' program is being
launched? ;)


0 new messages