How to share files with linux

How to share files through the local network?

I have a desktop (Ubuntu 13.04 & Win 7 Home Premium) and a Laptop (Ubuntu 12.04), both having WiFi adapters. I also have a WiFi router connected to internet which both my computers can access. I want to share files between my desktop and my laptop using WiFi (similar to Homegroup on Windows 7 but without using Ethernet cables). How do I set-up that? I want to share files using both OSs, if anyone have have information about sharing files with any of the OS please answer!

This is not a duplicate, as it asks about file sharing between Ubuntu and Windows as well as Ubuntu and Ubuntu machines. Note the desktop has both Ubuntu and Windows. When it is booted to Ubuntu and the laptop has Ubuntu, you have Ubuntu to Ubuntu file sharing.

3 Answers 3

Network Setup

Connect both the desktop and laptop to the WiFi router using standard setup. This means the any of the computers can be connected either by WiFi, or by Ethernet cables. However, if you later switch one (or both) computer(s) from WiFi to Ethernet cable (or vice versa), the local IP address of that computer will probably change. This will affect the file sharing setup.

To check that both computers are connected, test that you can get on the Internet from both computers.

Optional: In the router setup, see the local IP addresses assigned to the desktop and the laptop. These may look like 192.168.0.100 or 192.168.1.199. If an option to assign these specific IP addresses permanently in the router exist, you can do that.

Windows → Ubuntu

Step 1 On the laptop create a folder you want to share. There may be a folder called «Public» choose that one if you want. Right click the folder icon and choose «Sharing Options.» A new window will open up:

enter image description here

Check the box «Share this folder.»

You may also want to check the other two boxes «Allow others to create and delete files in this folder.» This will allow you the desktop Windows user to create and delete files on this folder.

The «Guest Access» check box is self explanatory. This may be useful if your Windows userID is not exactly the same as your Ubuntu user ID.

It may tell you Sharing service is not installed:

enter image description here

Click «Install Service» and let it install the software by providing the password for the laptop user account when it prompts. You may be prompted to install more software like libpam-smbpass . Install all the software. It will ask you to restart services and click Yes.

Читайте также:  Что такое embedded linux

Step 2. Open the property window of the «Public» folder, by right clicking on it. Go to the permissions tab and make sure it looks like this:

enter image description here

Click on «Change permissions of enclosed files» button and make sure it looks like this:

enter image description here

Now you should be able to edit files created in ubuntu in the «Public» folder of the laptop in the Windows Explorer.

However, if you create a file in Windows and put it in the Public folder of the laptop you may not be able to open that file when you get to the laptop. This is because Windows and Ubuntu do not understand each other’s file ownership and permissions. So in the Ubuntu laptop, the file created by Windows is owned by «Nobody». You will have to open Nautilus as an Administrator and change the ownership and read-write permissions while in the laptop.

Step 3. Go to the Windows on the desktop computer and open Windows Explorer, Click on the triangle next to Network on the left panel. From the drop-down list you should be able to select the name of the laptop computer running Ubuntu.

Now you should be able to see your shared folder (say «Public») from the laptop in the Windows Explorer. Click on «Public» folder and see the files in the folder. You should be able to copy files from the Public folder in Ubuntu to your Windows local folder.

Ubuntu → Windows

Step 1 Setup Windows folder sharing using methods available for Windows. follow the steps in the link above for the Windows part.

Step 2 Open a terminal in the Ubuntu laptop by pressing Ctrl + Alt + T and enter:

sudo -H gedit /etc/samba/smb.conf 
; name resolve order = lmhosts host wins bcast 

and edit it to look like this

 name resolve order = bcast lmhosts host wins 

Note, there is no ; in the beginning of the edited line. Save the file and exit gedit. Enter the following two lines (one at a time) to stop and start samba:

sudo stop smbd sudo start smbd 

Step 3 On the laptop, open Nautilus, the file browser and click on Network on the left panel. Click on «Browse Network» Click through the icons in the main Network window of Nautilus and find your Windows Desktop and shared folder. Verify you can copy files from and to this folder.

Ubuntu → Ubuntu

Boot the desktop to Ubuntu.

On both the desktop and the laptop do the following to make sure ssh-server is intalled:

Open a terminal by pressing Ctrl + Alt + T and enter

sudo apt-get install openssh-server 

Enter your password when prompted. The cursor will not move when you enter the password. This is normal.

Читайте также:  Astra linux межсетевой экран сертифицированный

This will install the ssh-server if it is not already installed. If already installed, it will do nothing.

The Desktop First:

Open Nautilus and find the Menu item «Other Locations». At the bottom find Connect to Server:

sftp connection7

Under Server Address Enter:

sftp://laptop_user_id@laptop_name.local/home/laptop_user_id 

where laptop_user_id is the user ID you created for on your laptop. You can find your user ID by typing whoami in a terminal. And laptop_name is the name you gave to the laptop when you installed Ubuntu.

If you want to share a partition in your second hard drive of the desktop, under Server Address Enter:

sftp://desktop_user_id@desktop_name.local/path/to/the/mount/point/of/the/partition/in/second/hard/drive 

Replace path/to/. /drive with the actual path.

Alternately, if you know the local IP address of your laptop you can replace laptop_name.local with the local IP address of the laptop.

Press Connect . You will see a password dialog box:

Password for SSH

Enter the password associated with laptop_user_id and select if you want the password is to be remembered or not. Again click Connect .

Now you should see your home folder of the laptop.

Notice there is a new entry under Network on the left panel of Nautilus that begins with laptop_user_id . Right click on it and choose «Add Bookmark» to create a permanent bookmark for your laptop’s home folder in the Nautilus of the Desktop.

Now the laptop

Follow the same process as the desktop above.

Источник

How to share files between a Linux and Windows computer

Computer Hope

The easiest and most reliable way to share files between a Linux and Windows computer on the same local area network is to use the Samba file-sharing protocol. All modern versions of Windows come with Samba installed, and Samba is installed by default on most distributions of Linux.

Create a shared folder on Windows

First, create a shared folder on your Windows computer.

Following the steps below, creates a shared folder on your Windows computer that lets you access files in that folder on your Linux computer. With the right permissions you can also copy, edit, and delete files in that folder from your Linux computer.

  1. Open the Control Panel.
  2. Select the Network and Sharing Options or Network and Sharing Center option.
  3. Click the Change advanced sharing settings link in the left navigation menu.
  4. Click the Turn on Network Discovery and Turn on File and Print Sharing options.
  5. Click the Save changes button at the bottom of the Advanced sharing settings window.

Now, create a new folder to share or choose an existing folder that you want to share.

  1. Right-click the folder and select Properties.
  2. Go to the Sharing tab.
  3. To share the folder with another Windows account, click the Share button, add the account to grant permission to access the shared folder, and click the Share button.

If you shared the folder with another Windows account, you need to click the Advanced Sharing button, then click the Permissions button. Select the account, check the Allow box for the Change or Modify permission, and click OK.

  1. Click the Advanced Sharing button.
  2. On the Advanced Sharing window, check the box for Share this folder and click OK.
  3. The network path for the folder is now displayed above the Share button, indicating that it is now a shared folder. For example, it may look like \\YOURCOMPUTERNAME\Users\YourUserName\ShareFolderName. Make a note of this network folder path to use later on your Linux machine.
Читайте также:  Pg dump linux install

Access a Windows shared folder from Linux using Konqueror

Many Linux distributions use the KDE (K Desktop Environment) and the Konqueror file manager/browser. If you’re using this, you can follow these steps to access your Windows shared folder.

  1. Click the K menu icon.
  2. Select Internet ->Konqueror.
  3. In the Konqueror window that opens, click the Network Folders link, or type remote:/ in the address bar and press Enter .
  4. Click the Samba Shares icon.
  5. Click the icon of your Windows Home workgroup.
  6. Click the Workgroup icon.
  7. Click the icon for your computer.
  8. When prompted, enter the username and password for the Windows account that created the share.
  9. Click OK.

Access a Windows shared folder from Linux using Nautilus

Many Linux distributions, especially those that use the GNOME desktop environment, use the Nautilus file manager. If you’re using this, you can follow these steps to access your Windows shared folder.

  1. Open Nautilus.
  2. From the File menu, select Connect to Server.
  3. In the Service type drop-down box, select Windows share.
  4. In the Server field, enter the name of your computer.
  5. Click Connect.

Alternatively, in the Nautilus address bar, you can type smb://ComputerName/ShareName and press Enter . For example, when you created your Windows Share if the share name was listed as:

\\YOURCOMPUTERNAME\Users\YourUserName\ShareFolderName

Type smb://YOURCOMPUTERNAME/Users/YourUserName/ShareFolderName and press Enter . Note the smb: at the beginning, in Linux, use forward slashes instead of backslashes.

Access a Windows shared folder from Linux using the command line

You can also access your Windows shared folder from the Linux command line using the smbclient program.

  1. Open a terminal.
  2. Type smbclient at the command prompt.
  3. If you receive a «Usage:» message, smbclient is installed, and you can skip to the next step. However, if the command is not found, you need to install smbclient. Follow these steps to install it.
  1. If you use the apt package manager, the default on Linux systems such as Ubuntu or Debian, you can use the sudo apt-get install smbclient command.
  2. If you use the yum package manager, the default on Linux systems, such as CentOS, you can use the sudo yum install samba-client command.
  3. You can also download the Samba client directly at www.samba.org/samba/download/, which might be useful to you if you need or want to compile the program from the source code.

Источник

Оцените статью
Adblock
detector