Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 4297
Next
In Process

askthedev.com Latest Questions

Asked: September 24, 20242024-09-24T21:07:02+05:30 2024-09-24T21:07:02+05:30In: Linux

What are the steps to enable folder sharing between two Linux computers connected to the same home network?

anonymous user

I’ve been trying to figure out how to share a folder between my two Linux computers at home, but I keep hitting a wall. I have both machines connected to the same network, yet I can’t seem to get them to communicate when it comes to file sharing. I see that there are so many different ways to do this, but I would really appreciate a clear step-by-step breakdown that isn’t too technical.

So, here’s my setup: I have a desktop and a laptop, both running Ubuntu, and I want to share a specific folder on my desktop so that I can easily access it from my laptop. I’ve read about Samba and NFS but honestly, the jargon is a bit overwhelming. I just want to be able to grab files from my desktop without having to transfer them via USB or email.

Can someone walk me through the process in a simple way? Like, what do I need to install, what commands do I need to run, and how do I ensure my network settings are correct? Are there any permissions or firewall settings I should be concerned about?

Also, if I want to keep the shared folder secure, how can I manage access? I don’t want anyone else on my network snooping around my files, so some tips on setting that up would be awesome too.

Lastly, are there any potential pitfalls I should be mindful of? I’d hate to mess something up and end up locked out of my own files. If anyone has gone through this process themselves, I’d love to hear some real-world experiences or maybe see what it looks like on your end. Thanks for any help you can provide!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-24T21:07:03+05:30Added an answer on September 24, 2024 at 9:07 pm



      Sharing Folders Between Ubuntu Computers


      How to Share a Folder Between Two Ubuntu Machines

      So, you want to share a folder between your desktop and laptop on your home network without getting buried in all that technical jargon? No worries, I got your back! Let’s break it down step-by-step.

      Step 1: Install Samba

      Samba is a tool that lets you share files easily between Linux machines. First, you need to install it on the desktop where the folder you want to share is located.

              sudo apt update
              sudo apt install samba
          

      Step 2: Create the Folder to Share

      Let’s say you want to share a folder named SharedFolder. Create it (if you haven’t already) in your home directory:

              mkdir ~/SharedFolder
          

      Put any files you want to share in this folder.

      Step 3: Configure Samba

      Next, you need to tell Samba to share this folder. Open the Samba configuration file with:

              sudo nano /etc/samba/smb.conf
          

      Scroll down to the bottom and add this section:

              [SharedFolder]
              path = /home/your_username/SharedFolder
              available = yes
              valid users = your_username
              read only = no
              browsable = yes
              public = no
              writable = yes
          

      Make sure to replace your_username with your actual username.

      Step 4: Set the Samba Password

      To secure your folder, set a password for Samba:

              sudo smbpasswd -a your_username
          

      Enter the password you’d like to use when prompted.

      Step 5: Restart Samba

      Now, restart Samba to apply the changes:

              sudo systemctl restart smbd
          

      Step 6: Configure Firewall (If Needed)

      If you have a firewall enabled, you need to allow Samba through it. You can do this with:

              sudo ufw allow samba
          

      Step 7: Access the Shared Folder from Your Laptop

      Now, on your laptop, open the file manager and in the address bar type:

              smb://your_desktop_IP/SharedFolder
          

      Replace your_desktop_IP with the actual IP address of your desktop. You can find this by running:

              ip addr
          

      It should be something like 192.168.1.x.

      Tips for Security

      To keep things secure, only give access to users you trust and use strong passwords. You can also use the valid users option in the Samba config to specify who can access the folder.

      Potential Pitfalls

      Be sure to check the following:

      • Correct paths in the Samba config.
      • Ensure both computers are on the same network.
      • If you change the configuration, always restart Samba.
      • Check firewall settings if having trouble connecting.

      That’s pretty much it! If you follow these steps, you should be good to go. Happy file sharing!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-24T21:07:03+05:30Added an answer on September 24, 2024 at 9:07 pm


      To share a folder between your two Ubuntu machines using Samba, you’ll start by installing Samba on your desktop. Open a terminal on your desktop and run the command sudo apt update && sudo apt install samba. After installation, create a directory that you want to share (e.g., mkdir ~/shared_folder), then modify the Samba configuration file by adding your shared folder. This can be done by editing the /etc/samba/smb.conf file. Add the following lines at the end of the file:

            [SharedFolder]
            path = /home/your_username/shared_folder
            available = yes
            valid users = your_username
            read only = no
            browsable = yes
            public = no
            writable = yes
          

      Make sure to replace your_username with your actual Ubuntu username. After that, set a Samba password for your user with smbpasswd -a your_username and restart Samba with sudo systemctl restart smbd. On your laptop, install Samba if you haven’t done so already, and then you can access the shared folder by typing in the file manager’s address bar: smb://your_desktop_ip_address/SharedFolder. Ensure that both machines are on the same network and check your firewall settings to allow Samba traffic. For securing access to your shared folder, you should set the valid users option in the Samba configuration to restrict access. Also, be cautious of giving too many permissions in the config file; just tailor it to what you need. If you experience issues, double-check both firewall and Samba settings, and consider running smbtree on your laptop to see if your desktop shares appear.


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • What could be the reason that using tcpdump with the -i any option fails to capture unicast traffic on a Linux bridge interface, such as br0?
    • How can I configure SELinux or AppArmor to permit only certain specified applications to execute on my system?
    • I'm trying to set up Virtual Routing and Forwarding (VRF) on my Linux system, but I'm not receiving any ping responses from the configured interfaces. I've followed the necessary steps ...
    • What distinguishes the /etc/profile file from the .bashrc file in a Linux environment?
    • What distinguishes the commands cat and tee in Linux?

    Sidebar

    Related Questions

    • What could be the reason that using tcpdump with the -i any option fails to capture unicast traffic on a Linux bridge interface, such as ...

    • How can I configure SELinux or AppArmor to permit only certain specified applications to execute on my system?

    • I'm trying to set up Virtual Routing and Forwarding (VRF) on my Linux system, but I'm not receiving any ping responses from the configured interfaces. ...

    • What distinguishes the /etc/profile file from the .bashrc file in a Linux environment?

    • What distinguishes the commands cat and tee in Linux?

    • What are some interesting games that can be played directly from the command line in a Linux environment?

    • How can I retrieve the command-line arguments of a running process using the ps command in Linux?

    • What are the files in a Linux system that start with a dot, and what is their purpose?

    • Is there a method to obtain Linux applications from different computers?

    • I'm encountering difficulties when trying to access a remote Linux server via SSH using ngrok. Despite following the setup instructions, I cannot establish a connection. ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.