Linux Administration Cookbook
上QQ阅读APP看书,第一时间看更新

Logging in from the host Terminal

Because using the VirtualBox interface is somewhat cumbersome (making things such as copy and paste tricky), it makes sense that there's a more elegant way to connect and interact with our machine.

Secure Shell (SSH) is the tool we're going to use for this, as it provides a fast and secure way of connecting to remote machines.

Native SSH clients are available for macOS and all Linux distributions. Windows has made some progress in the area too, though I'm to understand that the easiest way of using SSH on Windows is still to download a program called PuTTY.
Think of SSH as a Windows Remote Desktop Protocol. If you're new to this world, only it's generally faster to use, owing to the fact it's not got to stream a graphical connection at you. SSH is entirely text-based.

Using our IP address from a moment ago, we're going to try and SSH to our VM, from our host (the machine you're running VirtualBox on:)

$ ssh adam@10.0.2.15
ssh: connect to host 10.0.2.15 port 22: Connection refused

Oh no! Something is off!

We haven't connected, and the connection was apparently refused!