歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Fedora 17 開啟ssh服務

Fedora 17 開啟ssh服務

日期:2017/2/28 14:53:37   编辑:Linux教程

Fedora 17 已經安裝好openssh server了 不用再裝
不過默認無開啟

首先su root
1.開啟ssh服務
# systemctl start sshd.service

2.隨系統一起啟動服務

# systemctl enable sshd.service

在terminal 中輸 setup 對防火牆 添加22 端口

3.開啟防火牆22端口

# iptables -I INPUT -p tcp --dport 22 -j ACCEPT


測過ok

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
出現:[email protected]'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

Copyright © Linux教程網 All Rights Reserved