Centos7 install ssh service

Reprinted from: https://blog.csdn.net/mengyoufengyu/article/details/72855524

1. Check whether the related software is installed:

rpm -qa|grep -E "openssh"
  • 1

If the displayed result contains the following three softwares, it means that it has been installed, otherwise the missing software needs to be installed

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. Install the missing software:

sudo yum install openssh*
  • 1

3. Register to use the service:

sudo systemctl enable sshd  
sudo systemctl start sshd 或者
service sshd start 
  • 1
  • 2
  • 3

4. Open port 22 of the firewall: 
For specific firewall usage, please refer to: http://www.cnblogs.com/moxiaoan/p/5683743.html

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

5. Note: If the virtual machine is tested with the host, the network mode needs to be changed to 2. Bridged Adapter, see: http://blog.csdn.net/ixidof/article/details/12685549

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324778811&siteId=291194637