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' during boot, that would be enough. I have tried a few things, but the inittab/getty stuff is not cooperating. thanks
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 -
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
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?
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 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.
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?
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!
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.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.