Automatic login on Angstrom Linux

假装没事ソ 提交于 2019-12-18 09:42:25

问题


What is a clean way to obtain Angstrom Linux to boot up and open the shell without asking to log in?


回答1:


This simple answer took me hours to find. For those of you who don't have /etc/inittab the following worked for me. In

/etc/systemd/system/getty.target.wants/serial-getty@ttyO2.service

change the line

ExecStart=-/sbin/getty 115200 %I

to

 ExecStart=-/sbin/getty -a USERNAME 115200 %I

I partially figured this out on my own from reading about getty in /etc/inittab, which led me to ExecStart on my system, and a quick google search led me to https://unix.stackexchange.com/questions/42359/how-can-i-autologin-to-desktop-with-systemd which gave me the auto-login syntax of /sbin/getty.




回答2:


I found a nice way to achieve it. This works for me with Angstrom (on a Beagleboard xM Rev C4).

  1. Make sure agetty is installed (/sbin/agetty is the standard location). It should be included in every Linux Angstrom image.

  2. Create a script file in any location, for example /home/root/autologin.sh. Edit it and add the following:

    #!/bin/sh
    exec /bin/login -f root
    
  3. Make it executable with the command

    chmod a+x autologin.sh
    
  4. Edit the file /etc/inittab. Comment out (by adding a “#” at the beginning) the following line

    1:2345:respawn:/sbin/getty 38400 tty1
    

and add the following line:

    1:2345:respawn:/sbin/agetty -l /home/root/autologin.sh -n 38400 tty1 linux

Hope this helps out there.




回答3:


My answer is more linux-generic. Without a start of a getty-process you doesn't have a passwort login. Look at

/etc/inittab

starts here a *getty-process? Remove this line and restart your device.




回答4:


1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1

change tty1 for your system configuration, ex) ttyO0, ttyS1, etc..



来源:https://stackoverflow.com/questions/10282981/automatic-login-on-angstrom-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!