Another easy way to mount remote drives using SMB

En humans I found an interesting comment where they teach us another simpler method of mounting remote units using Samba (SMB), and leave said folder permanently mounted. This new and easy method complements the article very well previously posted by Hyuuga_Neji.

The procedure is the next:

1.- We create in the directory /half the folder where we will mount the remote network drive. We put it as SMB name, for example:

# sudo mkdir / media / SMB

We edit the file fstab with our favorite text editor:

# gedit / etc / fstab

At the end of the file we put the following line:

//10.0.0.1/d$ /media/SMB cifs user=UserX,password=PasswordX,noexec,user,rw,nounix,uid=1000,iocharset=utf8 0 0

Explaining the options:
1. The //10.0.0.1/d$ it is nothing more than the address of the remote unit to be connected
2. The / media / SMB is the address on our PC where we are going to mount the remote unit
3. The UserX is the user of the remote pc
4. The PasswordX is the password of the remote user

The other options have to do with the permissions with which you mount the units. These drives will mount automatically as long as the remote PC is powered on as is obvious.

Ready!!!


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   crotus said

    Very good Elav! To complement I add:

    Mount permanently without credentials (without username and password):
    //192.168.0.100/folder / media / cifs guest folder, _netdev 0 0

    Mount temporarily without credentials (without username and password):
    mount -t cifs -o guest //192.168.0.100/folder / media / folder

    Mount temporarily with credentials:
    mount -t cifs -o username = server_user, password = secret //192.168.0.100/folder / media / folder

    Regards!

    1.    Felipe said

      Hi dear, I was able to edit the fstab file correctly, however I don't have permissions to be able to save the file in / etc / fstab.

      I can do?

      Greetings.

      1.    Anonymous said

        hello you must run the terminal as super user

        sudo su

        It will ask you for the password of the machine, immediately the symbol # will appear at the end of the line, which indicates that you are in super user mode, now it will let you write the file ...

        regards

  2.   Daniel Rojas said

    Great, thanks for the tip 😀

  3.   Hyuuga_Neji said

    Wow, I didn't know that humanOS had taken my job… I have to go thank you

  4.   giskard said

    Note: The gedit command must also go with sudo.

  5.   truko22 said

    I use SMB4k, but it is good to know how to do it from the terminal 😀

  6.   arnold said

    What if I wanted to mount another folder?

  7.   Darius said

    Hello, fantastic blog.

    I have a question regarding this issue. If the user in question constantly changes his password due to security policies, how could we go about establishing that network drive assigned to that user whose password we do not know?

    Thank you very much for the help.

  8.   John Rivera said

    Hello, thanks for the blog.

    One Concern, How can I force the change immediately without restarting the server. Thank you.

  9.   markyosyo said

    @John Rivera
    mount -a