Install and use SSH tools on Linux


Preface

SSH (Secure Shell) is a network security protocol that uses encryption and authentication mechanisms to achieve secure access and file transfer. We can easily implement remote login and file transfer through SSH.

The following records how to configure SSH Server under Debian/Ubuntu system.


1. Install SSH Server

1. Install the ssh installation package

sudo apt-get install openssh-server
或者
sudo apt-get install ssh

2. Start ssh

sudo systemctl start ssh

3. Set up ssh to start at boot

systemctl enable ssh

2. Check SSH status

Method 1: Check the ssh service status

sudo systemctl status ssh

The execution effect is as follows:

Insert image description here

Method 2: Check if there is an ssh process

ps -ef | grep ssh 

The execution effect is as follows:
Insert image description here

3. Remarks

  1. If you encounter a situation where the ssh client cannot connect to the ssh server, you need to confirm whether the network of the two machines is normal and can communicate.

  2. If the network is normal, you need to confirm whether the firewall on the server side is turned off or a disconnection exception is added.

    Reference article:

    1. https://averagelinuxuser.com/how-to-install-and-use-ssh-on-linux/#install-ssh-server
    2. https://blog.csdn.net/java_dotar_01/article/details/76942563

Guess you like

Origin blog.csdn.net/xiao3404/article/details/131750400