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

重啟系統后,則系統會默認用設置好的用戶自動登錄

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM