openSUSE open sshd

OS: openSUSE-Leap-42.1 64-bit (ie openSUSE-Leap-42.1-DVD-x86_64.iso)

Remote connection tool: SecureCRT

 

Install openSUSE in VMware Workstation, configure the network connection, and use SecureCRT to connect remotely. When connecting for the first time, the connection fails. The reason is that the ssh service of openSUSE is disabled by default, and it needs to be opened before connecting remotely.

The opening method is as follows:

 

1. Log in with the root account;

 

2. Check if ssh is installed

Excuting an order

rpm -qa | grep ssh

 

As shown in the figure below, there is a display result, indicating that it has been installed:



 

 

If installed, go to step 3.

 

3. Check whether the ssh service is enabled

Excuting an order

service sshd status

 

If it is not turned on, go to step 4.

 

4. Execute the command vi /etc/ssh/sshd_config to modify the content:

   (1) Remove the comment of #PasswordAuthentication no and change no to yes;

   (2) Remove the comment of #PermitRootLogin yes

    (3) Save and exit 

 

5. Turn off the firewall, its firewall is not iptables

   5.1 Open the port number, execute the command vi /etc/sysconfig/SuSEfirewall2

         By default, FW_SERVICES_EXT_TCP = ""

                       FW_SERVICES_EXT_UDP = ""

         You need to add a port number for it:

          #The case of TCP port: 

          FW_SERVICES_EXT_TCP = "22"

          #UDP port case: 

          FW_SERVICES_EXT_UDP = "23"

   5.2 Save and exit

   5.3 Restart the firewall to take effect:

      先后执行以下的两个命令:

      service SuSEfirewall2 restart

      rcSuSEfirewall2 restart

 

6. 启动ssh服务

   执行命令:

   service sshd start

 

按照上面的设置之后,重启系统后ssh服务默认还是关闭的,所以需要将开启ssh服务设置成开机启动。

 

7. 在 openSUSE 系统启动的时候启动 ssh 服务

   (1)vi /etc/init.d/after.local

   (2)在其中加入 service sshd start

    (3)保存退出



 

这样设置之后,重启系统,ssh服务就会自动开启了。

 

8. 如果有必要重启 sshd 服务,则执行下面的命令

service sshd restart

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326920789&siteId=291194637