It took me more than an hour to open ssh in Ubuntu. The main reason was that the tutorial steps I read at the beginning were not detailed. Then I turned on a host worth more than 10,000 yuan, and the startup and shutdown were quite slow. I recorded the detailed steps here for your convenience in future reference. The first step is to check whether ssh is enabled. sudo ps -e | grep ssh If the final return is sshd, it proves that ssh has been enabled and jump to step 4 Step 2, if there is no display, try to enable the ssh service sudo /etc/init.d/ssh start If the command is not found, it means that the ssh service is not installed. The third step is to install the openssh service and check whether the service is enabled. sudo apt-get install openssh-server sudo ps -e | grep ssh If not, run the enable command sudo /etc/init.d/ssh start Step 4: Check if the firewall has port 20 open (SSH opens port 22 by default, if you need to modify it, see step 5) netstat -an | grep 22 # or ufw status If not, open port 22 ufw allow 22 Step 5: Change the ssh port (optional) sudo vi /etc/ssh/sshd_config ssh restart service sshd restart Step 6: Firewall takes effect and starts up ufw enable Step 7: Check the IP address, remember the IP address, and set a static IP ifconfig Set static ip: cd /etc/netplan/ ls vim 50-cloud-init.yaml Set to network: ethernets: enp3s0: dhcp4: false addresses: [192.168.101.135/24] gateway4: 192.168.101.1 nameservers: addresses: [192.168.101.1, 8.8.8.8] enp4s0: dhcp4: true version: 2 Next, ping the computer to see if it works. If not, check whether it is in the same subnet and gateway. Then download xshell or putty. Remember to enter the port correctly. Optional: Set up root login to ssh sudo vim /etc/ssh/sshd_config Change PermitRootLogin prohibit-password to PermitRootLogin yes sudo systemctl restart sshd Then the next step is to connect to the computer using xshell or putty, remember to select port 22, if you have not changed it This is the end of this article about how to enable ssh service in Ubuntu 19.10 (detailed process). For more information about how to enable ssh in Ubuntu 19.10, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JavaScript setTimeout and setTimeinterval use cases explained
I started learning MySQL recently. The installati...
Let's imitate Taobao's function of displa...
<iframe src=”test.jsp” width=”100″ height=”50″...
Below are some common parameters of /etc/my.cnf o...
This article introduces the import and export of ...
The scroll-view of WeChat applet has more bugs wh...
Here is how to install Tomcat-8.5.39 on centos7.6...
clear:both is used to清除浮動This is the impression I...
1. Pull the Mysql image docker pull mysql:5.7 2. ...
CSS Clear Default Styles The usual clear default ...
Table of contents 1. beforeCreate and created fun...
HTML forms are used to collect different types of...
= Only when setting and updating does it have the...
Format Encoding 1. Please set the page width with...
HTML to achieve simple ListViews effect Result: c...