Pages

Friday, March 14, 2008

File transfer between two machines running Ubuntu and using ssh.

I had successfully transferred a file from Windows machine to the one running Ubuntu through Samba but had no experience of a transfer between two Ubuntu machines.

I have an old desktop with 32 MB RAM on which Win98, Ubuntu server and Puppy Linux are installed. The CD drive on this machine still works. There is no USB port on this machine.

I have 3 years old Laptop on which the CD drive is not working and I don't intend to replace it.

Yesterday I was required to use some folders and files from a CD and decided to make an iso of the entire CD on the old desktop and transfer it to the Laptop by connecting the two machines.

For transferring the file I decided to use SSH, therefore I downloaded openssh-server on the desktop and installed it.

I made the iso using the dd command:
dd if=/dev/cdrom of=file.iso

I opened a Terminal on the Laptop and logged into the desktop through the command:
ssh desktopuser@ip_of_desktop

After confirming blah blah about RSA key etc I was asked the password and the terminal user changed as the desktopuser@desktop_host_name

I tried to transfer the file through scp command
scp file.iso laptopuser@ip_of_laptop:/home/laptopuser/

But found that the port 22 on the Laptop was closed.

I used the following command to see what was listening on the Laptop ports:
netstat -an | grep "LISTEN "

Although I was logged in from the Laptop to the Desktop no daemon was listening on port 22. I also changed the ssh client to openssh-client on the Laptop but could not make it listen on port 22.

I searched on Google but could not find any satisfactory solution.

Finally I decided to install openssh-server on the Laptop as well.

With openssh-server running on both the machine I could transfer the file that too after the server on the Laptop asked the password of the laptopuser.
Post a Comment