Quantcast
Channel: Admins Goodies » cifs
Viewing all articles
Browse latest Browse all 10

How do I pass credential file to mount.cifs?

$
0
0

Question

I’m maintaining a heterogeneous network of mac and linux so I decided to create a little perl script to unify mounting strategies across machines.

The current implementation in linux is in /etc/fstab works fine:

//myserverhere.com/cifs_share /mnt/cifs_share cifs
user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs 0 0

and /root/.cifs contains

username=ouruser
password=ourpassword

I tried translating that to a non-fstab format as follows:

mount.cifs //myserverhere.com/cifs_share /mnt/cifs_share user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs

But it doesn’t seem to work.

Can someone point out what I’m doing wrong please?

Thanks in advance.

Ismael Casimpan :)

Asked by icasimpan

Answer

Syntax of mount.cifs:

mount.cifs {service} {mount-point} [-o options] 

You need to pass the options after the “-o”; for example, if your options are rigth (not tested) your command should be:

mount.cifs //myserverhere.com/cifs_share /mnt/cifs_share -o user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs
Answered by hmontoliu

Viewing all articles
Browse latest Browse all 10

Trending Articles