(一)发行版:Ubuntu16.04.7
(二)记录:
(1)终端键入(root权限)安装
apt-get install openssh-server
安装时遇到报错
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
输入以下命令解决
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a
sudo apt update
解决参考:
【已解决】Could not get lock /var/lib/dpkg/lock-frontend_could not get lock /var/lib/dpkg/lock-frontend - o-CSDN博客https://blog.csdn.net/lun55423/article/details/108907779
(2)修改配置文件
a.在终端输入以下命令修改配置文件。
sudo vi /etc/ssh/sshd_config
b.在底部依次输入
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,
ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
c.由于ssh默认不允许root用户登录,所以还需打开配置文件修改
//进入配置文件
sudo vi /etc/ssh/sshd_config
//键入"/+单词"进行查找
/PermitRootLogin
(3)重启ssh
/etc/init.d/ssh restart
(4)在windows上安装ssh客户端SSHSecureShellClient-3.2.9.exe
下载地址: (安装一路next)ssh secure shell client下载-ssh secure shell client官方免费下载[网络监测]-华军软件园 (onlinedown.net)https://www.onlinedown.net/soft/10002183.htm
(5)Ubuntu和Windows互相ping 看是否通
(6)安装之后会出现两个图标
第一个用于连接Ubuntu控制台
第二个用于Windows和Ubuntu互传文件
(7)双击第二个图标
验证root密码成功之后
(8)示例:将Ubuntu的文件传给Windows
(9)示例:将windows上的文件传入Ubuntu
(10)示例:远程控制Ubuntu控制台删除刚才传入的readme.txt
a.打开第一个软件按照上述类似方法连接
b. 键入命令删除文件
c.查看Ubuntu中是否删除该文件
(三)命令: