Posted by jason on Dec 21, 2009 in
Ubuntu
The next thing we need to do is to set the network with your static IP addresses. First, edit the /etc/network/interfaces to include the following.
# /etc/network/interfaces
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
This assumes you want the ethernet card on eth0 configured. After this, we need to configure the primary and secondary DNS servers
# /etc/resolve.conf
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
After these are set, you need to restart the networking
sudo /etc/init.d/networking restart
Posted by jason on Dec 21, 2009 in
Ubuntu
First, make sure you can SSH to your server. If you need to install ssh on the Ubuntu server, use:
sudo apt-get install ssh
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
If you are wondering what the touch does, it just creates an empty file if it doesn’t exist. That way i don’t have to write two sets of instructions based on whether you’ve ever had SSH configured before. Next we are going to generate our keys and upload them to the server
ssh-keygen -t rsa
scp user@server.com:~/.ssh/authorized_keys ~/.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys user@server.com:.ssh/
What we are doing is copying the existing authorized_keys file to our local mac to add our key and then uploading it back. We should now be able to login to our server using our new keys.
ssh user@server.com
The Mac will now prompt you for the password you used to create your ssh key. Add it to your keychain. From this point forward, you will no longer be prompted with your password. Yay!