Fedora17安装SSH

1、在root权限下,修改ssh配置文件:vi /etc/ssh/ssh_config

将一下三个注释去掉,即去其前的“#”号:

RSAAuthentication yes

PasswordAuthentication yes

Port 22

2、启动SSH服务:service sshd start

3、测试是否安装成功:ssh 192.168,.253.18    #对方ip

出现: Are you sure you want to continue connecting (yes/no)? yes  #输入yes
出现:root@192.168.253.18's password:            #输入对方对应角色密码
提示:Last login: Sun Nov 18 14:34:41 2012 from 192.168.253.20   #登录成功

4、操作完成后一定要退出登录:logout    #忘记退出的后果是,所有命令行操作都在对方机器上!

以下为免密码登录配置:

1、生成密钥: ssh-keygen -t rsa

提示:

The key's randomart image is:
+--[ RSA 2048]----+
|           +*++..|
|         . ooo.. |
|        +   .o . |
|       + o .  + o|
|      . S .  o *.|
|       .    o .E+|
|             .   |
|                 |
|                 |
+-----------------+

2、密钥传给对方机器: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.253.18
3、再重新登录即可不用密码:ssh 192.168.253.18

PS:如果链接对方主机提示PORT 22 connection refused提示,可在对方主机上重新启动ssh服务:service sshd start

原文地址:https://www.cnblogs.com/fengfengqingqingyangyang/p/2775902.html