Install SSH service
There is no SSH service installed in Ubuntu by default. If you connect to Ubuntu via SSH, you need to manually install sSH-Server yourself. To determine whether to install SSH service, the following command can be used:
There is no SSH service installed in Ubuntu by default. If you connect to Ubuntu via SSH, you need to manually install sSH-Server yourself. To determine whether to install SSH service, the following command can be used:
- : www.linuxidc.com@linuxidc:~$SSH localhost SSH: connect to host localhost port 22: Connection destination: Connection union
As shown above, it means that it has not been installed yet. It can be installed through APT. The command is as follows:
- : www.linuxidc.com@linuxidc:~$sudo apt-get install openssh-server
The system will be installed automatically. After the installation is completed, the service will be started first:
- www.linuxidc.com@linuxidc:~$sudo/etc/init. D/SSH start ol>
After startup, you can check to see if the service started correctly with the following command
Ps
- www.linuxidc.com@linuxidc:~$- e | grep SSH 6212?00:00:00 SSHD ol>
As indicated above, start OK. Note that the default port for SSH is 22. You can change the port, stop,
and then start. The configuration is under /etc/ssh/sshd_config, as shown below.
- www.linuxidc.com@linuxidc:~$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 ol>
Finally, it’s time to connect. See the following command:
SSH [email protected]
- www.linuxidc.com@linuxidc:~$ ol>
Disconnect:
The
- exit ol>
Log into the virtual machine via Putty
First of all, make sure that the virtual machine and host can ping each other. If you can’t ping the general, then the follow-up work cannot be carried out. You can search the Web for references to articles on VIRTUAL machine IP configuration
Next, open the Putty client and the following interface appears. Fill in the relevant parameters:

Where the IP address is the IP address of Ubuntu in the virtual machine.
finally click Open to enter Putty, enter the user name and password to log in.