Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 131054  / 1 Year ago, wed, april 19, 2023, 8:10:38

Via Gnome Nautilus I can easily mount Samba shares from my Ubuntu Server. However, these "mounts" are kinda of fake. Many applications I run do not recognize that Gnome has mounted these server folders and therefore cannot open files off my server.



In the past I created an /etc/fstab entry and mounted them globally, the /mnt folder, but this isn't going to work as other people share my Ubuntu laptop.



What's the easiest way to create a "real" samba mount in my (and other people's) home directory? It's fine if its a command or a GUI application that can run when I log in. These server folders don't have to be mounted all the time.


More From » gnome

 Answers
5

Suppose you have a directory called mounts in your home directory in which you want various Samba shares to be mounted. Suppose further that you are specifically interested in mounting a share called sharename from a remote machine called hostname (this could also be an IP address), and on that remote machine your username is username. First, create the mount point:



mkdir ~/mounts/sharename



Then mount the share:



sudo mount.cifs //hostname/sharename ~/mounts/sharename -o user=username



In Ubuntu 12.04 LTS and earlier, if you don't have the mount.cifs command, you can either install the cifs-utils Install cifs-utils package, or use smbmount instead (which is, in turn, provided by the smbfs Install smbfs package).



sudo smbmount //hostname/sharename ~/mounts/sharename -o user=username



(smbmount is not available in Ubuntu 12.10 or higher, at least so far, but you can use mount.cifs instead. Thanks to HDave for pointing this out.)



You may be prompted for your password on the local machine, to run the command as root. Then you'll be prompted for your password on the remote machine, to log in so you can mount the share.


[#41688] Friday, April 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
onomicsiberated

Total Points: 217
Total Questions: 98
Total Answers: 107

Location: Luxembourg
Member since Sun, May 28, 2023
1 Year ago
;