Chinaunix首页 | 论坛 | 博客
  • 博客访问: 946960
  • 博文数量: 104
  • 博客积分: 1919
  • 博客等级: 上尉
  • 技术积分: 1910
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-21 16:33
文章分类
文章存档

2016年(4)

2015年(1)

2014年(6)

2013年(16)

2012年(27)

2011年(49)

2010年(1)

分类: LINUX

2012-12-13 16:29:59

选用的是Ubuntu 10.10 Mini版本的操作系统,一切都是从头开始安装的,所以比较清楚自己安装了些什么。GUI我只是安装了一个简陋的Wmaker。只是,有一个问题产生了, 启动的时候总是到字符界面等待用户输入用户名和密码。这个问题让我郁闷了很久!不过,在今天终于解决了,是通过下面这个文档成功的解决了。不用输入用户名密码,直接登录到指定用户的图形界面。是不是很酷呢!如果你感兴趣的话,可以看看下面的内容,之所以没有翻译,是因为本人认为E文是不可避免的。呵呵!
Ubuntu makes it easy to enable automatic login if you’re using a login manager such as GDM. I was recently setting up a minimal Ubuntu 9.10 system with an LXDE desktop and no GDM. Here’s how I enabled automatic login.
Note: This was tested on Ubuntu 9.10. Previous versions of Ubuntu require different procedures because of changes to the way Ubuntu boots.
Open /etc/init/tty1.conf as root:
sudo nano /etc/init/tty1.conf
Change the last line of this file to (where USERNAME is the username of the user you want to log in):
exec /bin/login -f USERNAME < /dev/tty1 > /dev/tty1 2>&1
Reboot, and the user you chose should be logged in automatically after boot. If something goes wrong, you can switch to a different TTY with CTRL+ALT+F2 and log in normally.
If you want this user to be logged into a graphical environment instead of just a shell, there’s more work to be done. Open your user’s .bashrc file:
nano ~/.bashrc
Add the following to the end of the file:
if [ $(tty) == "/dev/tty1" ]; then
startx
fi
This code will start X (the graphical environment) whenever the user logs in on TTY1. You can add more code after startx that will be executed if the user logs out of X.

转自:
阅读(4722) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~