Embedded Linux >> Auto login

by tns1 » Wed, 01 Oct 2003 13:30:41 GMT

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



Embedded Linux >> Auto login

by Marco Cavallini » Wed, 01 Oct 2003 17:29:52 GMT


> I need my system to autologin on a serial console when it boots. This

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
==============================================





Embedded Linux >> Auto login

by tns1 » Wed, 01 Oct 2003 22:31:39 GMT




Works great, thanks.



Auto login

by tns1 » Thu, 02 Oct 2003 00:03:17 GMT


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



Auto login

by tns1 » Fri, 03 Oct 2003 10:24:22 GMT






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?



Auto login

by Marco Cavallini » Fri, 03 Oct 2003 16:34:38 GMT

> It worked great until I had to add a password. Now it just asks for a

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




Auto login

by tns1 » Sat, 04 Oct 2003 01:33:33 GMT




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.



Auto login

by Marco Cavallini » Sat, 04 Oct 2003 01:47:14 GMT

> 1) For a normal user account

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




Auto login

by ih8sp4m » Wed, 08 Oct 2003 00:22:12 GMT





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.


Auto login

by tns1 » Wed, 08 Oct 2003 02:33:40 GMT




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.



Auto login

by tns1 » Wed, 08 Oct 2003 02:49:20 GMT




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?





Auto login

by John Williams » Wed, 08 Oct 2003 06:29:45 GMT






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



Auto login

by tns1 » Wed, 08 Oct 2003 09:16:32 GMT




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!



Auto login

by Marco Cavallini » Wed, 08 Oct 2003 16:20:47 GMT

> I don't think there is a way to do this for root. This example logs in

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

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

Ciao
Marco





Auto login

by tns1 » Thu, 09 Oct 2003 01:46:39 GMT


I see now that is it possible to prevent root login in sshd_config.
Thats allows me to remove the root pwd.



Similar Threads

1. How to auto-reboot a SUN, then auto-login, then auto-start a

2. uCLinux auto login

How do you get uClinux to automatically login?  I'm still getting up to
speed with Linux and Embedded Linux.


3. Auto login with ssh

4. Auto-login???

5. sco 5.0.7 ssh auto login - SCO Unix

6. Auto Login on Solaris 8 x86

I need a way of doing an auto login of an user after a reboot.
Is it possible? (on solaris 8 x86)

---------------------------------------
Andre Veloso Junqueira


7. auto login on e3500

8. AUTO LOGIN BUG