Fedora 17 已經(jīng)安裝好openssh server了 不用再裝
不過默認(rèn)無開啟
首先su root
1.開啟ssh服務(wù)
# systemctl start sshd.service
2.隨系統(tǒng)一起啟動(dòng)服務(wù)
# systemctl enable sshd.service
在terminal 中輸 setup 對(duì)防火墻 添加22 端口
3.開啟防火墻22端口
# iptables -I INPUT -p tcp --dport 22 -j ACCEPT
測過ok
1、在root權(quán)限下,修改ssh配置文件:vi /etc/ssh/ssh_config
將一下三個(gè)注釋去掉,即去其前的“#”號(hào):
RSAAuthentication yes
PasswordAuthentication yes
Port 22
2、啟動(dòng)SSH服務(wù):service sshd start
3、測試是否安裝成功:ssh 192.168,.253.18 #對(duì)方ip
出現(xiàn): Are you sure you want to continue connecting (yes/no)? yes #輸入yes
出現(xiàn):root@192.168.253.18's password: #輸入對(duì)方對(duì)應(yīng)角色密碼
提示:Last login: Sun Nov 18 14:34:41 2012 from 192.168.253.20 #登錄成功
4、操作完成后一定要退出登錄:logout #忘記退出的后果是,所有命令行操作都在對(duì)方機(jī)器上!
以下為免密碼登錄配置:
1、生成密鑰: ssh-keygen -t rsa
提示:
The key's randomart image is:
+--[ RSA 2048]----+
| +*++..|
| . ooo.. |
| + .o . |
| + o . + o|
| . S . o *.|
| . o .E+|
| . |
| |
| |
+-----------------+
2、密鑰傳給對(duì)方機(jī)器: ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.253.18
3、再重新登錄即可不用密碼:ssh 192.168.253.18
PS:如果鏈接對(duì)方主機(jī)提示PORT 22 connection refused提示,可在對(duì)方主機(jī)上重新啟動(dòng)ssh服務(wù):service sshd start
本篇文章來源于 Linux公社網(wǎng)站(www.linuxidc.com) 原文鏈接:http://www.linuxidc.com/Linux/2013-01/78033.htm