How to install and use SSH ubuntu in ubuntu is not installed by default. If you connect to ubuntu through ssh, You need to manually Install ssh-server. To determine whether to install the ssh service, run the following command: xjj @ xjj-desktop :~ $ Ssh localhost ssh: connect to host localhost port 22: Connection refused as shown in the preceding figure, indicating that no installation is available. You can install it through apt by running the following command:-desktop :~ $ Sudo apt-get install openssh-server xjj @ xjj-desktop :~ $ Sudo apt-get install openssh-server www.2cto.com will be installed automatically. After the installation is complete, start the service: @ xjj-desktop :~ $ Sudo/etc/init. d/ssh start xjj @ xjj-desktop :~ $ Sudo/etc/init. d/ssh start after startup, you can run the following command to check whether the service is correctly started @ xjj-desktop :~ $ Ps-e | grep ssh 6212? 00:00:00 sshd xjj @ xjj-desktop :~ $ Ps-e | grep ssh 6212? 00:00:00 sshd www.2cto.com. Note that the default port of ssh is 22. You can change the port, stop it, and then start it. Modify the configuration in/etc/ssh/sshd_config, as shown below. Xjj @ xjj-desktop :~ $ Vi/etc/ssh/sshd_config # Package generated configuration file # See the sshd (8) manpage for details # What ports, IPs and protocols we listen for Port 22 # Package generated configuration file # See the sshd (8) manpage for details # What ports, IPs and protocols we listen for Port 22 www.2cto.com, it should be the connection time. See the following command: xjj @ xjj-desktop :~ $ Ssh exceljava@192.168.158.129 xjj @ xjj-desktop :~ $ Vi/etc/ssh/sshd_config