Raspberry Pi auto login without etc/inittab

前端 未结 4 2215
闹比i
闹比i 2021-01-18 01:34

I would like to settup my Raspberry Pi to auto login in a specific user. I googled this and the solutions that i found were about editing the /etc/inittab file. My problem i

4条回答
  •  佛祖请我去吃肉
    2021-01-18 02:03

    I assume you're using the latest Raspian-Image (jessie). This one is based on Debian 8 (jessie) where the init-system changed from sysvinit to systemd. I think that it could have something to do with your problem. If you google: raspbian jessie auto login you should find a solution for your problem.

    p.e. this link provides a possible solution:

    $ sudo -i
    # mkdir -pv /etc/systemd/system/getty@tty1.service.d
    # nano /etc/systemd/system/getty@tty1.service.d/autologin.conf
    

    insert the following text:

    [Service]
    ExecStart=-/sbin/agetty --autologin $username --noclear I 38400 linux
    

    make sure that $username is your username

    Then reboot.

    optional:

    If you want to start the X-Server automatically, just add the following line at the end of your ~/.profile

    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
    

提交回复
热议问题