Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to do a connection for my work computers d: from my laptop. Altough to have direct access to the disk I need to use the computers administrator account. And I would not like to save the password for the administrator account in fstab file on my laptop.

# work share
//172.16.8.2/d$         /home/user/domain/d   smbfs username=administrator,domain=domain,user,rw,noauto  0  0

This is how it looks in the terminal

$ mount ~/npn/d
Password: 

And I get the thing mounted in no time.

Now to the trouble: If I try to "click" the d "drive" in the file browser I'm met by this error box:

Unable to mount d
Password: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Logic, because the graphical interface can't throw me a password login promt like the terminal.

Is there any way for me to solve this problem, to just be able to "click" on the unmounted d drive and get a GUI passpromt thrown?

share|improve this question
add comment

2 Answers

You have two options.

I believe you are being asked the SAMBA password, so add in the password to the fstab entry:

username=administrator,password=admin_samba_password,domain=domain,user,rw,noauto

If you do not want the password in fstab, use a credentials file

http://anothersysadmin.wordpress.com/2007/12/17/howto-mount-samba-shares-in-fstab-using-a-credential-file/

If you want to mount share files using samba but you don’t want to put the username or password on fstab file, you could use an external file, this is useful if you want to increase a little security since fstab usually is world readable.

Using /etc/fstab

insecure and common usage

//share/dir /mnt/myshare cifs username=user,password=pass

more secure usage

mkdir /path/securedir chmod 0700 /path/securedir chown root /path/securedir //share/dir /mt/myshare cifs credentials=/path/securedir/fileshare

cat /path/securedir/fileshare username=yourusername password=youpass

As you can see, it’s easy and increase a little security if more users can access in you machine.

of course you can use smbmount too:

smbmount //share/dir /mnt/myshare -o credentials=/path/securedir/fileshare

Your other option, and the one I use, is autofs

https://help.ubuntu.com/community/Autofs

It takes a little time to configure, but it is mounted on demand and is invisible to the end user.

share|improve this answer
    
wouldn't it be better to quote relevant parts from the linked content? Especially with the credential file? The reason the credential files are superior to throwing it into the fstab is because fstab can usually be read by anyone, whereas the credential file can be protected extra. –  0xC0000022L Apr 9 '13 at 22:06
    
Depends on what the OP wants, I can flesh out the answer –  bodhi.zazen Apr 9 '13 at 23:01
add comment

bodhi.zazen: I believe you are being asked the SAMBA password

Yes it's the samba password that is being asked for in the terminal. There doesn't seem to be a good solution to bringing a GUI popup to enter the SAMBA password. And since I don't want to save the password in either credential file, fstab or individual autofs files. I will live with it as it is and start a terminal and write:

mount ~/npn/d

and then enter the SAMBA password in the terminal.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.