networking - How do I set up file sharing between two Ubuntu laptops on my wireless network?

23
2014-04
  • deshmukh

    I have two laptops running Ubuntu 12.04. Both connect to the same WIFI network to access internet.

    How do I connect them to each other so that I can access files on one from another and vice versa?

    Also, how do I manage the user permissions, etc. on them?

  • Answers
  • One Zero

                               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.

    sudo apt-get install openssh-server openssh-client
    

    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.

    On the computer you want to access the files from, go to “File -> Connect to Server”.

    enter image description here

    enter image description here

    enter image description here

    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.

    You should have read/write permissions.

    enter image description here

  • One Zero

                   A Quick Way to Share Folders in Ubuntu

    Objectives:

    Share a folder between 2 Ubuntu using samba PC's

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    sudo smbpasswd -a USERNAME
    
  • LinuxPCplus

    I have tried this but I get the following error: 'net usershare' returned error 255: net usershare add: cannot share path /home as we are restricted to only sharing directories we own. Ask the administrator to add the line "usershare owner only = false" to the [global] section of the smb.conf to allow this. Share Error

    I am on 12.04 as are all of the computers in my home. I get the same result with all 5 machines.


  • Related Question

    samba - Share between Ubuntu machines
  • Anero

    I'm sure it might be a very easy way to do this, but I haven't found how... I have two machines with Ubuntu 10.10 on the same network (just workgroup, no domain involved). On one of them I have shared a folder through Nautilus Folder Sharing. When opening the Network place on the second machine, I cannot see the first one listed, just Windows Network and when going into this folder I can see the Workgroup though when trying to go into it I get an Unable to mount. Failed to retrieve share list from server error.

    Is it required to do something else when sharing the folder through Nautilus?


  • Related Answers
  • Bruno Pereira

    Method 1:
    You can use SAMBA for file sharing(but samba is mostly used to share files between linux and windows machines)

    • In terminal type the following gksudo gedit /etc/samba/smb.conf

    • Add the line usershare owner only = False to the [global] section.

    • Go to Places>>Computer.

    • Right click the folder you want to share and choose Sharing Options. alt text

    • Check the box that says Share this folder.

    • Write your share name and check the box that says Allow other people to write in this folder.

    • Now you should be able to see and access the shared folder from your network.

    Method 2:
    You can use Openssh run the following to install it,

    sudo apt-get install openssh-server openssh-client
    

    Now goto Places menu and choose Connect to Server

    (In oneiric (11.10), click desktop and use the menu at the top: File --> Connect to Server)

    alt text

    • In the Service type: Select SSH

    • In Server: give the IP address of the PC where the info is on.

    • In Port: give 22.

    • Now in Folder: Pick the folder you wish to share.

    • In User Name: give the username of the pc you are connected to.

    • Click Connect after that you will get a windows where you have to enter a password of the PC you are trying to connect to.

    • Now you have read/write permissions.

  • aneeshep

    There are many ways to share files b/w two Linux systems. The most easy and common way is SSH.

    Method 1: SSH

    Install ssh on both systems.

    sudo apt-get install openssh-server openssh-client
    

    Then Go to 'Places' menu and select 'Connect to server'.

    alt text

    Method 2: use giver

    Giver allows you to drag and drop files to users on your network. It will also automatically detect other Giver users on your network.

    When you drag a file, or multiple files, to a user represented by an avatar on the Giver window, the files are automatically transferred. The recipient of the files is warned that a user wishes to send files. The user can accept or decline them.

    To install giver in ubuntu: sudo apt-get install giver

  • Syzygy

    Once you set up an SSH server on one machine, you can simply connect to the other one via Nautilus by typing sftp://192.168.1.3 (or whatever the actual IP number of the other machine is) in the location bar (invoked with CTRL-L).

  • jet

    if no Windows machines involved - only Linux, you can use NFS (more native for linux)

    nfs shares

    long story short:

    on server: in /etc/exports you put the folders need to be exported

    on the clients: mount the share (auto in /etc/fstab or manual- CLI or nautilus)

  • jokerdino

    I have a big computer which we will call Upstairs and a little computer which we will call Downstairs. They are on the same network, connected by the same router. Upstairs is running Kubuntu (12.04) whereas Downstairs is running bogstandard Ubuntu (13.04, with KDE desktop). I prefer to work on Downstairs but often need to access my files on Upstairs, which my partner may be using at the time.

    I shared some Upstairs directories using Samba first of all and this was a nightmare. First of all it didn't work recursively (I had to mark every directory and sub-directory) I wanted to share). Secondly, although Downstairs could see Upstairs on the network, when I clicked into the shared directories I kept being prompted for a password, and although I was entering it correctly the password was not recognized so I couldn't get in. I am tempted to forget Samba altogether but first let's see how it gets on with making my Upstairs music files available to my excellent internet radio.

    Next I tried nfs as suggested by the user jet. Following the instructions suggested by the link, this worked perfectly the first time. Unfortunately when I tried again the following day after both computers had been rebooted, I kept getting mount.nfs: Access Denied... messages. This problem is well documented in the forums but the multifarious proposed solutions are beyond my level of technical ability.


    This was my solution. Install ssh on the host (server) computer (or both), as suggested by aneeshep:

    sudo apt-get install openssh-server openssh-client
    

    Now on the client computer (or both) install a package called sshfs:

    sudo apt-get install sshfs
    

    Using your preferred file manager on Downstairs, check that Upstairs is on the network. If so, make a directory on Downstairs where you will mount the Upstairs file system. Let's call it /home/me_downstairs/UpstairsFiles/

    Now, at the command line, type something like, followed by Return:

    sshfs [email protected]:/home/me_upstairs /home/me_downstairs/UpstairsFiles/
    

    (This is all on one line.)

    Of course, replace 'Upstairs' by the name of your computer as shown on the network, but the .local suffix is important.

    You will be prompted to enter your Upstairs password.

    Now, in the directory /home/me_downstairs/UpstairsFiles/ on Downstairs I can see all my Upstairs files and use them as normal.


    This website below suggests some extra steps may be necessary but they weren't for me:

    http://itecsoftware.com/mount-remote-folder-via-ssh-using-sshfs

    Please let me know if this did or did not work for you.