August 2025
Intermediate to advanced
272 pages
6h 14m
English
To try things out here, you’ll want to have a remote machine somewhere running SSH on a port that is exposed to the Internet—the standard SSH port is 22. You could test this out with a local Docker container[195] if you don’t have a machine to SSH to.
Use :ssh.connect/3[196] to establish an SSH connection. The user you specify needs to be able to SSH into the machine. ssh looks up keys for the user based on filename. The API is somewhat quirky if you want arbitrary key names, so for simplicity you might want to name your user’s key one of id_dsa, id_rsa, id_ecdsa, id_ecdsa, or id_ed448—depending on the key algorithm.
| | iex> Application.ensure_all_started(:ssh) |
| | iex> connect_options = [user: ~c"andrea", user_dir: ... |
Read now
Unlock full access