Ubuntu 16.04 单root登录

共533个字

环境搭建好后,用创建的用户进入系统

shell命令:

sudo vim usr/share/lightdm.conf.d/50-ubuntu.conf //编辑器不限
[SeatDefaults]
user-session=ubuntu
greeter-show-manual-login=true     #手工输入登录系统的账号密码
allow-guest=false                  #禁止guest登录

修改root密码

sudo passwd root

 

 修改/root/.profile
sudo vim /root/.profile //root首次登录会报错解决方法

# ~/.profile: executed by Bourne-compatible login shells.

if [ “$BASH” ]; then

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

fi

#mesg n  注释掉mesg n 增加一行tty -s && mesg n

tty -s && mesg n

 修改ssh配置文件允许root登录
sudo vim /etc/ssh/sshd_config
#permitRootLogin without-password 注释掉这行,新增下面一行
permitRootLogin yes
重启ssh服务即可
❤ 喜欢 22

2条回应:“Ubuntu 16.04 单root登录”

  1. I got this site from my friend who shared with
    me concerning this site and now this time I am visiting this
    web page and reading very informative articles at this place.

  2. gamefly说道:

    When someone writes an article he/she retains the
    plan of a user in his/her brain that how a
    user can know it. So that’s why this article is amazing.
    Thanks!

发表评论

必填项已用*标注

归档于 Ubuntu