SSH 远程管理服务
一、ssh简介
1.1)SSH是一个安全协议,在进行数据传输时,会对数据包进行加密处理,加密后在进行数据传输。确保了数据传输安全。那SSH服务主要功能有哪些呢?
1.提供远程连接服务器的服务
1)linux远程连接协议: ssh服务 端口22
2)windows远程连接: RDP协议 端口3389
2.对传输的数据进行加密
1.2)以下服务对应的端口号或者端口对应的服务
ssh 22
telnet 23
http 80
https 443
ftp 20 21
RDP 3389
mysql 3306
redis 6379
zabbix 10050 10051
elasticsearch 9200 9300
rsync 873
rpcbind 111
二、ssh和telnet
1.ssh和telnet的区别
telnet:
1.不支持root用户登录,只允许普通用户登录
2.数据传输过程中明文的
ssh:
1.支持root用户登录
2.数据传输过程中时加密码
2.使用telnet连接服务器
准备服务器:
主机 | ip |
---|---|
m01 | 192.168.15.71 |
2.1)、创建一个普通用户
[root@m01 ~]# useradd test
[root@m01 ~]# passwd test
Changing password for user test.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
2.2)安装telnet服务
[root@m01 ~]# yum install telnet telnet-server -y
2.3)安装网络工具
yum install net-tools -y
2.4)连接telnet服务
[root@m01 ~]# systemctl start telnet.socket








三、SSH服务相关的命令
3.1
ssh root@192.168.15.71 [command]
ssh 连接的命令
root 连接的用户
@ 分隔符,没有特殊意义
192.168.15.71 连接IP
command 需要执行的命令




3.2 生成密钥证书:ssh-keygen
会在家目录中生成一个.ssh的目录,其中包含id_rsa,id_rsa.pub文件
id_rsa 私钥(私钥)
id_rsa.pub 公钥(锁)








3.3 ssh-copy-id -i ~/.ssh/id_rsa.pubroot@192.168.15.71
ssh-copy-id 将公钥复制到指定服务器中命令(可以免密登录)
-i 指定公钥
root 用户
@ 分隔符,没事特殊意义
192.168.15.71 IP
结果:会在指定的服务器中创建~/.ssh/authorized_keys ,并且会将本服务器中的公钥复制到其中,以至于实现免密登录。








四、SSH的验证方式
1)、密码验证
直接输入密码即可。
2)、密钥验证
通过公钥和私钥验证的。
密钥的方式比较安全
五,xshell 工具生成公钥




然后下一步,下一步








下一步把密钥文件复杂进去
vi.ssh/authorized_keys








私钥可能保存到Windows里了
然后测试连接:








2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/8310.html