SSH (Secure Shell) is a protocol used to securely connect to remote machines.
You can use it to connect to your virtual machine.
Important
Windows users: Use WSL (Windows Subsystem for Linux).
Do not use PowerShell, cmd.exe, or Git Bash — the commands below are not guaranteed to work there.
- Method 1: Login using a password
- Method 2: Login using an
SSHkey
Password-based authentication asks you to type the password of the user.
Key-based authentication uses your SSH private key to prove your identity.
The remote host checks whether the matching SSH public key is listed as authorized.
This is the recommended method.
See Set up the SSH access to the VM as the user <user>.
SSH uses a key pair for authentication:
An SSH public key is the shareable half of an SSH key pair.
You give your public key to remote hosts — they store it in ~/.ssh/authorized_keys to recognize you on future connections.
The public key file has a .pub extension (e.g., se_toolkit_key.pub).
An SSH private key is the secret half of an SSH key pair.
It stays on your local machine and is never shared. During authentication, SSH uses it to prove your identity without sending it over the network.
Caution
Never share your private key. Anyone who has it can authenticate as you.
sshd (the SSH daemon) is a program that runs on the remote host and listens for incoming SSH connections.
You do not need to configure it — your VM already has it running.
ssh-agent is a background program that stores your private SSH key in memory for the duration of your session.
When ssh-agent holds your key, you do not need to type a passphrase every time you connect.
An SSH shell is the interactive shell session you get after connecting to the VM over SSH.
Commands you run in it execute on the remote machine, not on your local computer.
A typical SSH shell prompt looks like:
<user>@<host>:<directory-path>$
See:
Note
The $ at the end indicates a regular user.
A # indicates the user root.
-
To check whether you run an
SSHshell,w -
Look at the
FROMcolumn.If the value in that column:
- is an IP address, you run in an
SSHshell. -, you run on your local machine (computer).
- is an IP address, you run in an
scp (Secure Copy) copies files between machines over SSH.
Common pattern:
scp -r <local-path> <user>@<host>:<remote-path>
The -r flag copies directories recursively.