Open SSH service under Ubuntu

Under VMware WorkStation, I installed Ubuntu, and then used XManager's XShell to connect to my Ubuntu on the Windows desktop, but at the same time it prompted the connection failure.

Then I used the Windows CMD command prompt to ping the Ubuntu IP, and the connection was normal. Why can't I connect with XShell? So I guessed that Ubuntu did not enable SSH service by default.

SSH is divided into client openssh-client and server openssh-server.
If you just want to log in to the SSH of another machine, you only need to install openssh-client (Ubutntu has a default installation, if not, sudo apt-get install openssh-client), if you want to open the SSH service on this machine, you need to install openssh-server.

Here I use the command sudo apt-get install openssh-server to install the server SSH.

Then use the command to confirm whether sshserver is started: ps -e |grep ssh

If you see sshd, then ssh-server has been started.

If not, you can start it like this: sudo /etc/init.d/ssh start
The ssh-server configuration file is located in /etc/ssh/sshd_config, where you can define the SSH service port, the default port is 22.

Then restart the SSH service:
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start

Set the ssh service to start automatically after booting:

Configure openssh-server to automatically start at boot in Ubuntu
Open the /etc/rc.local file and add the following statement:
/etc/init.d/ssh start

Recommended Posts

Open SSH service under Ubuntu
Open SSH service under Ubuntu
Ubuntu19.10 open ssh service (detailed process)
DNS service construction under Ubuntu
Method steps for installing and configuring SSH service under Ubuntu 18.04
Ubuntu startup service
Install apache+PHP under Ubuntu
Install node.js under Ubuntu
Install python3.6 under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Install OpenJDK10 under Ubuntu
Install Caffe under Ubuntu 14.04
Python MySQLd under Ubuntu
Open ssh on Ubuntu/Mac
[python] python2 and python3 under ubuntu
Use iptables under ubuntu
2018-09-11 Install arduino under Ubuntu
LNMP installation under Ubuntu
Network configuration under Ubuntu
Ubuntu ssh Android phone
Install ROS under ROS Ubuntu 18.04[2]
Install MySQL under Ubuntu
Install Yarm-PM2 under Ubuntu
ubuntu open designated port
Cpp web (1) Install and use Crow service under Ubuntu
How to open https on nginx server under Ubuntu
Django&MySQL environment deployment under Ubuntu 14.04
Ubuntu Server Chapter 8 DNS Service
Ubuntu opens SSH service for remote login and file transfer
Solve Unment dependencies under ubuntu
Use sublime tex under ubuntu
ubuntu 16.10 supports ssh remote access
Modify shortcut keys under Ubuntu 18.04
ubuntu7.10 installed to 3D open
Use of mediawiki under ubuntu
Install server-side Shadowsocks under Ubuntu 16.04
Install rgl package under Ubuntu
CentOS 7 set up NTP, SSH service
Use QQ under Ubuntu 13.10, suitable for 14.10
Installation of deb package under Ubuntu
How to compile ijkplayer-android under ubuntu
Install 3 single-cell R packages under Ubuntu
Tencent Cloud Ubuntu 18.04 open root login
Install and deploy Gerrit under Ubuntu
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Install JDK1.8 original under Ubuntu Kylin
Redis installation under ubuntu and windows
Small tool: install screenshot tool under ubuntu
Install nodejs and npm under Ubuntu 16.04
Python Chinese encoding setting under ubuntu
Ubuntu 16.04 installation graphic tutorial under VMware 12
Installation of Docker CE under Ubuntu
Coexistence of CUDA8.0 and CUDA9.0 under Ubuntu 16.04
How to install Audacious under Ubuntu
How to install Tensorflow under ubuntu 16.04
Compile and install QEMU under Ubuntu
Windows Ubuntu subsystem ssh and ftp
Ubuntu18 restart docker service failed memo