SSH into UTM VM
07/31/2023
Go back
You're here because you'd like to know how to ssh into a UTM VM.
Here are the steps:
-
Click on your target VM in the
UTM UI.
-
Navigate to the top right button (Settings) and click it.
-
Go to Network and set Network Mode to Emulated VLAN.
-
Click on Port Forwarding (it should show up under Network).
-
Click 'New' and select Protocol: TCP. Set up Guest Port (second field) of 22 and Host Port (fourth field) of your choice (I use 2222).
-
Start up the VM. Inside, you can run sudo systemctl start sshd and verify that the ssh daemon is running with sudo systemctl status sshd.
-
You can now run ssh user@localhost -p 2222, replacing user and 2222 as necessary in order to ssh into the VM.
-
As a bonus, you can also scp files into the home directory (or one of your choice) with scp -P 2222 file user@localhost:~ where you specify 2222, file and user as necessary.