一、你需要准备
1. Ubuntu Server 18.04 LTS 镜像
下载地址https://ubuntu.com/download/server
2.Vmware Workstation安装包(仅供测试学习使用,切勿用于商业用途)
下载地址https://www.52pojie.cn/thread-1027984-1-1.html
二、新建虚拟机
三、安装系统
1.设置语言
2.设置网络连接
3.设置代理
4.配置镜像地址( 阿里云镜像地址http://mirrors.aliyun.com/ubuntu)
5.文件系统设置
6.这里要选安装OpenSSH服务 后期通过XShell或者Putty连接
7.等待安装
8.安装完毕 重启
四、重启
1.安装完成
2.测试登录
3.为root账户设置密码sudo passwd root
4.切换至root用户su root
5.开启SSH允许通过root登录
- 编辑sshd_config文件
vi /etc/ssh/sshd_config 1.允许root账户登录 PermitRootLogin without-password 修改为 PermitRootLogin yes 2.允许密码登录 PasswordAuthentication no 修改为 PasswordAuthentication yes 3.关闭证书验证登录(确认可以使用密码登录后再做此修改,避免发生无法登录服务器的验证后果) UsePAM yes 修改为 UsePAM no
- 重启sshd服务
sudo service ssh restart
五、用ssh工具测试连接
- 查看ip地址
ifconfig
- 用ssh工具新建会话
- 设置密码
- 连接
i- 连接成功!