#Linux(SSH软件安装及简单使用)

(一)发行版: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中是否删除该文件


(三)命令:

相关推荐
轻松Ai享生活5 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr5 小时前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5556 小时前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆6 小时前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
乌萨奇也要立志学C++6 小时前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
绿箭柠檬茶7 小时前
Ubuntu 服务器配置转发网络访问
服务器·网络·ubuntu
獭.獭.8 小时前
Linux -- 信号【上】
linux·运维·服务器
hashiqimiya8 小时前
centos配置环境变量jdk
linux·运维·centos
hashiqimiya8 小时前
权限更改centos中系统文件无法创建文件夹,使用命令让普通用户具备操作文件夹
linux
路由侠内网穿透9 小时前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip