标签:服务 登录 启动 ssh 设置 Ubuntu root 远程
系统环境
我们的系统采用的是虚拟机 vmware workstations 12版本 + Ubuntu17.04 进行实验:
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/login-1.png)
安装ssh服务
检查网络的连通性
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/net-ok.png)
升级安装源(第一次使用必须的)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/update-apt-get.png)
安装ssh服务
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-not.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/%E5%AE%89%E8%A3%85ssh.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-install-2.png)
启动ssh服务
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-start1.png)
检查ssh服务启动状态
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/netstat-22.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ps-ssh.png)
设置ssh服务开机启动
尝试使用chkconfig设置ssh开机启动
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/chkconfig-shh.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/install-conf.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/install-conf-1.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/chkconf-not.png)
systemctl 设置ssh服务开机启动
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-systemctl-enable-start.png)
修改ssh配置文件,开启root用户登录
查看IP尝试远程登录
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/IP-addr.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/tcping-22.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh.png)
ok,普通用户登录成功。我们尝试切换到root。
切换到普通用户
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/su-root-not.png)
修改root的密码
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/chpasswd-root.png)
尝试用root用户登录系统
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-root.png)
修改ssh的配置文件,启用root登录
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/sshd_conf.png)
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/sshd_config-2.png)
使用root用户进行root登录
![Ubuntu 系统远程设置Ubuntu 系统远程设置 Ubuntu 系统远程设置Ubuntu 系统远程设置](https://www.linuxprobe.com/wp-content/uploads/2017/07/ssh-root-ok.png)
标签:服务,
登录,
启动,
ssh,
设置,
Ubuntu,
root,
远程
From: https://www.cnblogs.com/roccn/p/17719116.html