Using Secure Shell to Connect to Remote Machines

Secure Shell, or SSH, is an encrypted and secure method for logging in to remote machines. You can also use it to execute commands remotely, and use related tools to copy files securely.

This is the standard way to log into remote Linux servers, either in your own data center or in the cloud. In this section, you’ll use your local machine to connect to your Ubuntu virtual machine.

First, on your Ubuntu machine, install the openssh-server package and enable SSH connections:

 (ubuntu)$ ​​sudo​​ ​​apt​​ ​​install​​ ​​openssh-server

This installs and activates the SSH server on port 22.

Identify the IP address of your Ubuntu machine using the ip addr command, and use grep to look for inet in the ...

Get Small, Sharp Software Tools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.