Ubuntu 20.04 configures ssh remote service
Preface:
This article mainly introduces how to configure the ssh service in the ubuntu20.04 system. If you have any questions, welcome to feedback.
1. Install ssh online
Install ssh-client command: sudo apt-get install openssh-client
install ssh-server command: sudo apt-get install openssh-server
Offline installation method:
sudo dpkg -i openssh-client-xxxxx.deb
sudo dpkg -i openssh-server-xxxxx.deb
Download address: https://ubuntu.pkgs.org/20.04/ubuntu-main-amd64/
Note:
openssh-server depends on
openssh-sftp-server_8.2p1-4_amd64
ssh-import-id_5.10-0ubuntu1_all service
If openssh-server installation fails, please install openssh-sftp-server and ssh-import-id first
sudo dpkg -l | grep ssh //Search ssh related service status
2. Start the service
/etc/init.d/ssh start
View ssh service status sudo service ssh status
is normally active (running)
3. Modify the ssh login configuration
sudo gedit /etc/ssh/sshd_config
1) Change the line PermitRootLogin prohibit-password to PermitRootLogin yes
2) Remove # in front of port 22
4. Restart the ssh service
sudo service ssh restart
5. View your own ip address:
ifconfig -a