1.进入Linux 系统安装SSH :

    sudo apt-get install openssh-server -y

输入密码后发生报错:

    E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 11919 (unattended-upgr) N: Be aware that removing the lock file is not a solution and may break your system. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

解决办法:

输入 ps   -aux 查看所有运行的进程11

 

使用 kill -9  pid 进行关闭进程: 

报了 Operation not  permitted, 使用sudo su (Ubuntu只允许sudo增加特权级别,而不是su (其他发行版不同))

2.进程关闭后重新执行 sudo apt-get install openssh-server -y 安装 ssh ,安装成功后使用ifconfig 查看链接的ip地址:

3. 打开MobaXterm ,新建session:

 

4.填写ip地址和自命名(自命名不能随便写,要和Ubuntu内部的用户名同步,不然会报:MobaXterm连接虚拟机时出现Access denied ):

5.填写账户密码,登录该ssh:

6.链接成功后,就可以完全基于命令操作这个远程的Ubuntu 虚拟机了:

 

 

 

 

 

更多推荐