Ubuntu17 root ssh
Posted AutoHome7390
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu17 root ssh相关的知识,希望对你有一定的参考价值。
Ubuntu provides OpenSSH (OpenBSD Secure Shell) in its universe repositories, which is a suite of security-related network-level utilities based on the SSH protocol.
1. To install it, open terminal (Ctrl+Alt+T) or log in Ubuntu server and run command:
sudo apt-get install openssh-server
2. After that, you should have SSH service enabled in your system, you may check its status by running command:
sudo service ssh status
3. You may change some settings (e.g., the listening port, and root login permission) by editing the configuration file via command:
sudo nano /etc/ssh/sshd_config
On Ubuntu desktop, you may use gedit
instead of nano
: add this command in file
PermitRootLogin yes StrictModes yes
Finally apply the changes by restarting or reloading SSH:
sudo service ssh restart
以上内容完全盗版自:
http://ubuntuhandbook.org/index.php/2016/04/enable-ssh-ubuntu-16-04-lts/
在这里郑重的说一句,盗版要盗全套,哈哈哈~~~
由于不习惯使用非root用户,直接启用root账户方法:
1、修改root 密码:
sudo passwd root
输入两次root用户密码
2、创建 /etc/lightdm/lightdm.conf
vi /ect/lightdm/lightdm.conf
输入一下内容:
[SeatDefaults] greeter-session=unity-greeter user-session=ubuntu greeter-show-manual-login=true
3、重启系统
4、用root登录桌面后,会弹出 读取/root/.profile时发现错误:mesg:ttyname failed:对设备不适当的ioctl操作 信息,解决办法:
将/root/.profile文件中的mesg n
替换成tty -s && mesg n
5、重启。
参考文章:
http://www.configserverfirewall.com/ubuntu-linux/enable-ubuntu-desktop-root-login/
以上是关于Ubuntu17 root ssh的主要内容,如果未能解决你的问题,请参考以下文章
ubuntu的root用户无法ssh远程连接的一种原因及其解决方法