Use this so you can SSH into a VM you just made.
On the HOST
For Virtual Box:
Put Network Settings from NAT
to Bridged Adapter
the Host VM.
To start headless : Hold shift down and clic start button
On the server you will be SSH'ing into:
sudo apt-get install openssh-client
# incase you want to ssh from the VM at some point.
sudo apt-get install openssh-server
Once the above are installed:
sudo /etc/init.d/ssh restart
Make sure the .ssh
directory exists in the home directory of the user you will be logging on as.
On the client you will SSH From
This is if the authorized_keys file DOES NOT exist:
On the server:
mkdir ~/.ssh
On the client
scp ~/.ssh/id_rsa.pub {username}@{IP Address or DNS Name}:~/.ssh/authorized_keys
If authorized keys DOES exist:
cat ~/.ssh/id_rsa.pub | ssh {username}@{IP Address or DNS Name} "cat - >> ~/.ssh/authorized_keys"
Then make sure permissions are correct:
chmod 0700 ~/.ssh
chmod 0600 ~/.ssh/authorized_keys
When you're all done, add the connection info to your ~/.ssh/config
file.