1. 程式人生 > >centos7安裝ssh服務

centos7安裝ssh服務

client sys tty tar html mct one www net

1、查看是否安裝了相關軟件:

rpm -qa|grep -E "openssh"

顯示結果含有以下三個軟件,則表示已經安裝,否則需要安裝缺失的軟件

openssh-ldap-6.6.1p1-35.el7_3.x86_64
openssh-clients-6.6.1p1-35.el7_3.x86_64
openssh-6.6.1p1-35.el7_3.x86_64
openssh-askpass-6.6.1p1-35.el7_3.x86_64
openssh-server-6.6.1p1-35.el7_3.x86_64
openssh-keycat-6.6.1p1-35.el7_3.x86_64
openssh-server-sysvinit-6.6.1p1-35.el7_3.x86_64

2、安裝缺失的軟件:

sudo yum install openssh*

3、註冊使用服務:

sudo systemctl enable sshd  
sudo systemctl start sshd 或者
service sshd start 

4、開啟防火墻的22端口:
具體防火墻使用可以參見:http://www.cnblogs.com/moxiaoan/p/5683743.html

sudo firewall-cmd --zone=public --add-port=22/tcp --permanent  
sudo service firewalld restart  

5、備註:虛擬機如果和主機進行測試,需要將網絡模式修改為2. Bridged Adapter,具體參見:http://blog.csdn.net/ixidof/article/details/12685549

轉載自:http://blog.csdn.net/mengyoufengyu/article/details/72855524

centos7安裝ssh服務