Ubuntu opens SSH service and uses XShell to connect

step

1. Check whether the SSH service is installed

Command: dpkg -l | grep ssh

2. If the ssh service is not installed, you need to execute the following command

命令:sudo apt-get install openssh-server

After the installation is complete, execute the command to check whether the installation is successful ps -e | grep ssh;


If the installation fails, execute the command sudo apt-get update to update

Wait for the update to complete and execute the following command

sudo apt-get install openssh-server (reinstall SSH service)

Successful installation

3. After the installation is complete, you can use XShell to connect.

Use command: ifconfig to view computer IP

4. If you need to view the SSH service port number, execute the following command

sudo  vim /etc/ssh/sshd_config

5. If SSH login fails, please try to deal with it

  •  Check the situation of port 22 and find that port 22 is not open;

Command: netstat -ntlp|grep 22

If it is not enabled, execute the following command:

sudo ufw enable 

sudo  ufw allow 22

  • Reconnect with XShell

 

 

 

Guess you like

Origin blog.csdn.net/h610443955/article/details/115203577