ssh介绍
SSH 是Secure Shell 的缩写 SSH 为建立在应用层基础上的安全协议。专为远程登录会话和其他网络服务提供安全性的协议
SSH 协议可以有效防止远程管理过程中的信息泄露问题。
SSH 适用于多平台
ssh安装
yum install openssh-server // contos
ssh启动
service sshd start
开机启动
chkconfig sshd on
yum install openssh-server
ssh config
| 关键字 | 描述 | 
|---|---|
| host | 别名 | 
| HostName | 主机名 | 
| Port | 端口 | 
| User | 用户 | 
| IdentityFile | 密钥文件路径 | 
ssh免密登陆
吧客户端公钥 ,放到需要免密登陆的Linux /root/.ssh/authorized_keys
ssh免密登陆
- 生成密钥
 
ssh-keygen -t rsa
- 复制密钥到免密登陆到服务器 ssh-copy-id 服务器ip
 
ssh-copy-id 192.168.2.169
ssh端口修改
/etc/ssh/sshd_config
service restart sshd.server
contos7连接慢
vim /etc/ssh/sshd_config
将#UseDNS yes
改为 UseDNS no
重启ssh解决
service sshd restart