ubuntu自动登录tty1(shell,text)配置

1.编写登录脚本-autologin:

#!/bin/bash
/bin/login -f <username>
#你的用户名

将autologin文件移到到/usr/bin/下,并且用chmod +x autologin设置可执行权限

2.修改/etc/init/tty1.conf

修改前:

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -8 38400 tty1

修改后:

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -n -l /usr/bin/autologin -8 38400 tty1

重启系统后,则系统会默认用设置好的用户自动登录

 

posted @ 2017-08-14 10:07  牛头人  阅读(3753)  评论(0编辑  收藏  举报