2012年3月16日 星期五

[Linux] ubuntu 11.04 autologin text mode

ubuntu 11.04
一:開機自動login到文字模式                    
1.修改/etc/defautle/grub
nash@ubuntu:/$ sudo vi /etc/default/grub 

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet text"
GRUB_CMDLINE_LINUX=""
..........
..........
..........
更新
nash@ubuntu:/$ sudo update-grub

2.下載mingetty,and修改tty1.conf
nash@ubuntu:/$ sudo apt-get install mingetty
nash@ubuntu:/$ sudo vi /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
exec /sbin/mingetty --autologin username tty1 #username=自己的帳號

3.重開機
nash@ubuntu:/$ sudo reboot

二:取消sudo密碼
nash@ubuntu:/$ sudo vi /etc/sudoers

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
USERNAME ALL=(ALL) NOPASSWD: ALL
#includedir /etc/sudoers.d


參考文章:
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?viewmode=compact&topic_id=43964&forum=22
http://www.gnu.org/software/grub/manual/grub.html
http://ecken-tw.blogspot.com/2009/12/ubuntu-910-desktop-console-mode.html
http://www.linuxquestions.org/questions/linux-desktop-74/%5Bubuntu-10-04%5D-root-auto-login-to-console-mode-806030/
http://chiahu.com/blog/?p=456

沒有留言:

張貼留言