If you have two computers running Ubuntu on the same network, it could be an good idea to use openssh to share files between them.
The setup shouldn’t take more than 2 minutes.
updated for Ibex.
On all the computers you want to share files with copy/paste the following command.
Ubuntu 8.04:
sudo apt-get install openssh-server openssh-client
Ubuntu 8.10:
sudo apt-get install ssh
Then you need to figure out the ip of each the computer you want to connect to.
Most of the time it’s something like 192.168.1.2 or something in that line.
(kde, cli and another option is presented in bottom of thread)
Right-click the network-manager applet on the top panel and choose “connection information” to find it out.
On the computer you want to access the files from, go to “Places -> Connect to Server”.
You’ll get greeted by this window.
Service type should be “SSH”"
Server should be the “ip” adress of the pc where the info is on.
Port, enter “22″
Pick the folder you wish to share (could take some time to connect depending on the size of the folder).
The user name of the pc you are connected to
The bookmark will be the name of the folder in nautilus
After that you’ll get a windows where you have to enter a password. That would be the password of the pc you are trying to connect to.
And that’s it.
You should have read/write permissions.
You can also connect to your Ubuntu pc running openssh from windows using “Putty” or from OSX using “Fugu”. It should work the other way around too.
Note: It might be a good ideo to turn of root logins (for security reasons).
In a terminal
sudo gedit /etc/ssh/sshd_config
Change the line “PermitRootLogin yes” to “PermitRootLogin no”.
————–
This won’t be possible for all people (for instance when you use fluxbox), then you could try the things below here or just use “gftp”. It has an easy to use UI.
————–
If you are using Kubuntu, you can connect to the ssh server using konqueror.
Just type
fish://user@server/path/to/folder
So in reality it could something like this
fish://rw@localhost/home/rw
This would bring you to the /home of the server.
or
fish://rw@192.168.1.3/
This would bring you to / of the server.
—
If you are on fluxbox, openbox, … nautilus won’t be able to handle ssh (or smb). You could still use konqueror but you most likely won’t like that.
Then you could use the cli client of you choice and do
ssh user@server
For me this would be:
ssh rw@192.168.1.3
And you would be able to browse the server using the terminal.
Some basic terminal commands are given here.
However, you could use sshfs to mount the the ssh share as a filesystem.
There are instructions to get it working on the official website, but ubuntu.wordpress.com has a nice how-to.








30 Comments
June 8, 2008 at 9:02 pm
[...] Share files between 2 ubuntu computers If you have two computers running Ubuntu on the same network, it could be an good idea to use openssh to share files between them. The setup shouldn’t take more than 2 minutes. On all the computers you want to share files with … [...]
July 7, 2008 at 1:45 am
Excellent. I am now able to “securely” share files between my computers without the need fro removable media.
Thank you.
July 7, 2008 at 9:11 am
Nice guide dude
July 9, 2008 at 11:05 pm
Thanks.
This is one of my favorite posts on this website, because I know a lot of people need this.
And I believe this is the easiest way (and easiest guide on the internet) to get Ubuntu computers to share files (stream files) with each other.
July 17, 2008 at 4:50 pm
Wonderful, thank you. But there are two things that are not clear to me right now:(I just followed what is written)
1-Do we have to repeat this process each time we login?
2-How do I disconnect (or do I have to disconnect) if I want to shutdown the connected computer?
July 17, 2008 at 5:24 pm
Hey.
To answer you questions:
1. Yes.
2. There is no need to disconnect if you want to shutdown.
July 20, 2008 at 1:19 pm
Excellent post – much easier than smb share
Just to clarify last comment:
You don’t have to repeat the whole process each login, just need to click on your chosen bookmark under “Places” or in the left-hand pane of Nautilus. I’m not sure what the :p:p signifies, you just need a sensible bookmark name.
July 20, 2008 at 5:00 pm
The :p :p was me trying to be funny.
It’s one of those smilies.
For me it’s not always there, I just repeat it every time.
It only takes 4-5 seconds, so it’s not a big deal.
July 21, 2008 at 9:14 am
Sorry I didn’t get it – thicko I guess.
August 5, 2008 at 2:04 pm
[...] (for the graphical way to do this: link) [...]
August 24, 2008 at 1:51 pm
Should you get rid of samba before you install SSH?
August 24, 2008 at 3:30 pm
@ Poliltimmy:
No.
Samba shouldn’t interfere with Openssh.
August 24, 2008 at 9:04 pm
I downloaded it. I ran on it the computer my family uses first but then they could see right in to my file system, the whole nine yards. Not an acceptable out come for me. On my computer my account and the user account on the family computer I could access. Just the opposite of my desired outcome. I have tried to remove and reinstall and run them the other way around ( mine first).
Now I cannot hook up in either direction.
Couldn’t display “sftp://john@192.168.15.2/home”
Error: Host key verification failed Please select another viewer and try again. Any suggestions from anyone would welcome.
August 24, 2008 at 9:13 pm
If you have problems with openssh, please ask them on the help forum of your linux distro.
I would love to help, but I never had that problem, so I’m not sure what causes it.
October 8, 2008 at 12:00 pm
If you look in your pic above you will see that you indeed have a sftp mount at 192.168.1.14
this will show you the whole file system of the user’s PC that you have mounted. this is dangerous and although usefull is missing some scripting with something like username=dbott,password=mysecretpassword,uid=1000,mask=000
October 8, 2008 at 12:07 pm
In your defence, a properly configured system would let permissions deal with it in which case its is safe’ish IE: you should not be able to even read /etc/passwd or shadow etc so if your groups are setup correctly (usually IS NOT SO) then this is a fine idea and much better than SMB
December 22, 2008 at 2:33 pm
[...] thanks to the guys at Linux Owns who provided the inspiration and some of the content for this post. I wanted something that was a [...]
January 22, 2009 at 11:11 am
This saved my stuff man! I have to do an emergency reinstall of Ubuntu to try and save my CD-ROM, which doesn’t work, but I don’t have a backup USB device big enough for the stuff on my computer. Now it can all go to my other laptop while I trouble shoot this one. Thanks!
January 28, 2009 at 9:15 pm
Hi,
Followed the post easily enough but both laptop and desktop (both wired to the same router) time out when trying to connect. Do you have to have the directories set as shares that you’re connecting to? Thanks.
February 7, 2009 at 6:43 am
A few questions: It appears to me that my notebook has NO ip address. Is that because I am connected wireless to my router?
eth0 Link encap:Ethernet HWaddr 00:1a:80:f8:02:31
inet6 addr: fe80::21a:80ff:fef8:231/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:238 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:18703 (18.7 KB) TX bytes:1836 (1.8 KB)
Interrupt:16
The second question is when I connect the two computers could I mess up my wired Internet connection? On my desktop computer?
February 7, 2009 at 3:16 pm
@ JohnPta
Question 1:
I presume you did ifconfig to get that output. Use iwconfig instead.
Question 2: No.
February 9, 2009 at 7:29 pm
Ok as I understand from looking through websites is iwconfig used for wireless networks. I want to connect with a cable to my desktop machine.
Than I did manage to connect with a cross over cable but at the point of connection the computers are asking me for a password, where and what password is it/ssh looking for??
February 10, 2009 at 3:49 pm
The password ssh is asking for is the one you use to login with on the machine you are connecting to.
March 5, 2009 at 12:49 pm
thank you so much, i have been trying to connect both machines for so long now using other guides with no luck. try your steps works right away. your a legend
March 26, 2009 at 6:24 pm
Any way to connect Ubuntu box to Linux Mint box? I’ve been trying to no avail.
April 17, 2009 at 5:14 pm
I have been trying to hook up a nfs network. This did not work at all but now I can,t connect with openssh either.
I can connect from the other computer but can not go from the box that I was trying to configure as nfs server.
I do not believe that I have anything that I edited that is not back the way it was.
What I am getting is;
Cannot display location “sftp://slade@192.168.1.xxx/home”
Host key verification failed
(I inserted the xxx)
I autoremoved ssh (using 8.10) and then apt-get installed it back thinking that may help but it did not.
I also tried connecting with the same box on another partition with Hardy on it and that failed too so it has to be on this box.
WTF?
April 29, 2009 at 5:18 am
Thanks a lot, very helpful
April 29, 2009 at 8:52 am
@ Metal Smith:
http://www.cyberciti.biz/faq/howto-regenerate-openssh-host-keys/
May 24, 2009 at 3:40 pm
Thank you so much! Go ssh!
May 28, 2009 at 6:29 am
linuxowns,
Sorry not to get back but it was the end of calving season and the start of branding, no time to breath.
That fixed it right up. I can see that this may not be good for some but it is just what we need.
I love this ssh stuff. It is fun.