ubuntu配置登陆用户为root

## 更改默认登陆用户

```

root@liusiyao:~# vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

[Seat:*]

user-session=ubuntu

[SeatDefaults]

autologin-user=root      ##这里更改用户

user-session=ubuntu

greeter-show-manual-login=true

```

```

root@liusiyao:~# vim /root/.profile

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

if [ "$BASH" ]; then

  if [ -f ~/.bashrc ]; then

    . ~/.bashrc

  fi

fi

tty -s && mesg n || true    #要添加的

```

## 关于ssh设置

```

vi /etc/ssh/sshd_config  #调整PermitRootLogin参数值为yes

```

## 重启ssh服务

```

service sshd restart

```

你可能感兴趣的:(ubuntu配置登陆用户为root)