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!!!
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!
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.
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
Great, thanks for the tip 😀
Wow, I didn't know that humanOS had taken my job… I have to go thank you
Note: The gedit command must also go with sudo.
I use SMB4k, but it is good to know how to do it from the terminal 😀
What if I wanted to mount another folder?
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.
Hello, thanks for the blog.
One Concern, How can I force the change immediately without restarting the server. Thank you.
@John Rivera
mount -a