在虚拟机上安装Ubuntu server并开启SSH服务

1 安装 Ubuntu server

1.1 虚拟机

我是在 Parallels Desktop 14 for Mac上安装的Ubuntu系统,需要的可以留言,看到后回复。

1.2 下载Ubuntu系统

http://mirrors.163.com/ubuntu-releases/

image.png

我用的当时的最新版ubuntu-19.10-live-server-amd64.iso,桌面版太大,也觉得没必要。

image.png

1.3 安装Ubuntu

安装过程注意看提示就行了,设置服务器名字和用户名以及密码时,注意下,别忘了就行,SSH登录需要。

1.4 安装完成后,查看ip。

ifconfig

如果报错,就按照提示安装一下。

2 开启ssh

2.1 安装ssh-server

sudo apt install openssh-server

2.2 启动ssh服务

sudo /etc/init.d/ssh start 

或者

service ssh start

2.3 查看服务状态

ps -e | grep sshd
image.png

2.4 查看ssh服务状态

service ssh status

2.5 停止ssh服务

service ssh stop 

3 远程连接

3.1 查看 ip

ifconfig
image.png

3.2 远程登录

3.2.1 在 Mac 默认终端登录

image.png

3.2.2 在 其他工具中登录

image.png

你可能感兴趣的:(在虚拟机上安装Ubuntu server并开启SSH服务)