wpd 发表于 2014-7-16 10:30:35

【求助】lubuntu默认root自动登陆!

装了一个lubuntu server版,本来都很顺利,可是昨天连了VGA显示器一看发现居然root已经自动登陆了,设置了root密码也是一样自动登陆。

个人能力有限,实在不知道那里出了问题,希望大家能够提供帮助,谢谢!

ps.linaro用户已经被我删掉了。

wpd 发表于 2014-7-17 01:38:39

自己解决了!

在/etc/default目录下有一个autogetty文件,内容如下:

    # here you can provide what to run instead of /bin/login
    AUTOGETTY_ARGS="-n -l /usr/bin/auto-root-login"

    # Should autogetty be enabled?
    ENABLED=1

只要将ENABLE=1改成ENABLE=0就可以了。

彬仔 发表于 2014-9-16 10:38:19

正需要的,谢谢

彬仔 发表于 2014-9-16 12:05:40

我试过了,修改之后,串口无法控制,只能用SSH控制

QQLinux 发表于 2014-9-27 14:56:52

wpd 发表于 2014-7-17 01:38 static/image/common/back.gif
自己解决了!

在/etc/default目录下有一个autogetty文件,内容如下:


lubuntu-server-nand-vga.img       lubuntu server官网下载的最新版,按此方法试过了,不行。

whisper 发表于 2014-11-26 23:43:47

wpd 发表于 2014-7-17 01:38 static/image/common/back.gif
自己解决了!

在/etc/default目录下有一个autogetty文件,内容如下:


试过了,本地还是依然root登录,ssh远程已经无法访问。。。。

谁解决这个问题了,粗来分享下经验子撒~~

whisper 发表于 2014-11-27 00:09:43

找到解决办法了。。。。哈哈哈哈~~~~~

执行:mv /etc/init/openvt.conf /etc/init/openvt.conf.bak 就可以解决问题啦!!!

参考资料:Ok, I figured it out. So this is how login works. There is an init script in /etc/init/tty1.conf which runs getty. Getty is a program that waits for login connections, and then authenticates a user. I initially thought getty was being run with autologin, and so I looked for a line in /etc/init/tty1.conf like
exec /sbin/getty -8 38400 -a root tty1
which means, open an 8bit terminal at 38400 baud and autologin the root user into tty1. But when I looked at the file, there was no -a option to autologin the root user. I'm stating this because /etc/init/tty1.conf should be the first place to look if others face the same issue.

Then I looked through the /etc/init/ directory and found a file called openvt.conf. This had the following line:
exec /bin/login -f root
This was the culprit. The login command with the -f option automatically logs the user in without authentication.

Since the openvt.conf file is intended to be an upstart service, it has to be disabled in a particular way, although one can also simply delete the file. See this askubuntu post about upstart. In short, either delete the openvt.conf file, or run
echo manual | sudo tee /etc/init/openvt.override
and then root is no longer logged in automatically.出处:http://superuser.com/questions/783560/linaro-system-boots-to-root-without-password
页: [1]
查看完整版本: 【求助】lubuntu默认root自动登陆!