Monthly archive September, 2010

SSH Login Without Password:

I’m working on an automated rsync script that requires remote access to another machine on the local network.  The easy and secure way to accomplish this is to connect using SSH.  The problem I found while testing the script is that it will not run because it’s prompted by the remote machine for a password each time.  Okay I’ll just use key-only login which doesn’t require passwords, easy enough, right?  Well.. though the commands were simple enough to configure SSH login this way I couldn’t ever get it working properly.  I gave it one last try using ssh-keygen and actually got it working!  I thought I’d share the process I followed for success in case anyone else is experiencing the same headache:


I’m using 2 machines.  “localpc” is the machine which will run the script so I want passwordless login to the other host.  “remotepc” is the machine I wish to login to.


Clear your .ssh/ directory on both localpc and remotepc for the user you wish to login as.  This helps to start from scratch with no possible issues in the key files.

sudo rm –R /home/user/.ssh/*

Login to localpc from remotepc through SSH normally:

ssh user@localpc

and do the same from the other machine:

ssh user@remotepc

I’m not completely sure why but this helps alleviate a “no identities error” that can happen later on.


On localpc:

Create an RSA key:

ssh-keygen –t rsa

Chose the default Save location (Just press Enter)

Chose no passphrase (Press Enter again)


On localpc:

ssh-copy-id -i /home/user/.ssh/id_rsa.pub user@remotepc

Make sure and change the user and remotepc to the names that represent your setup.


You’re Done!  Test it out. 

On localpc:

ssh user@remotepc

apt-get upgrade Confusion

While performing some regular maintenance on one of my Ubuntu machines I was getting a bit confused between all of the upgrade commands, so I investigated further.  I’ve listed below the basic differences between each:

sudo apt-get upgrade

install newest versions of packages on machine

sudo apt-get dist-upgrade

upgrades all packages on system, handle dependency changes (remove obsolete packages).  This command prepares the system for upgrade but since /etc/sources.list is not changed to the sources for the newer distribution it will not actually upgrade to the newest version.

To actually perform a distribution upgrade the following command should be used (ensure you have a backup before issuing this command.  The upgrade could make your system unstable):

First, check which version you are currently running using the following:

lsb_release -a

Next, you can download the newest update manager and issue the upgrade command:

sudo apt-get install update-manager-core
sudo do-release-upgrade

All of these commands should be used with caution as you are directly affecting your software packages installed on the system.

This site was very helpful in my initial investigation of the differences of this command.