Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 8741  / 2 Years ago, mon, april 18, 2022, 5:49:06

I'm trying to automount some drives with smb with fstab entries as such.



# auto mount hda shares
//hda/DeannasDocs /home/deanna/DeannasServerDocs cifs user=deanna,pasword=** 0 0
//hda/Music /home/deanna/ServerMusic cifs user=deanna,pasword=** 0 0
//hda/Pictures /home/deanna/ServerPhotos cifs user=deanna,pasword=** 0 0


if I click on one of these drives I get an error "only root can mount"



If I manually mount with



sudo mount -a


I'm prompted for a password and they mount just fine. What the heck is going on here?



Answer: Of course it was something stupid.



I copied the syntax for the mount from offline and it has "pasword" instead of "password". It stood out initially but I thought it was just a Unix foible.


More From » root

 Answers
2

As a default, only root is allowed to mount / unmount volumes. You have to allow for other users with the "user" or "users" mount option, for example:



//192.168.1.100/Daten /home/otto/Daten cifs noauto,users,credentials=/home/otto/.smbcredentials  0 0


Where the .smbcredentials file contains username and password:



username=otto
password=wakeuplimeyfish


The noauto option means that the system will not mount the share automatically.



Of course, you do not need all of that to mount a Windows share as a regular user. Just open a file manager window and go to Browse Network -> Windows Network, select the share you want to mount, type the password etc. Or give the location (menu go -> location): smb://Fileserver/share, type in your domain / password etc.



Or use gvfs directly from command line:



gvfs-mount 'smb://user@fileserver/share'

[#36067] Tuesday, April 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
anatta questions
Sun, Jul 17, 22, 07:13, 2 Years ago
Sun, Jun 6, 21, 12:17, 3 Years ago
Sat, Jun 12, 21, 20:43, 3 Years ago
Thu, Jan 13, 22, 20:49, 2 Years ago
Sat, Jun 5, 21, 05:39, 3 Years ago
;