# unable to mount cifs as user [SOLVED]

## alex.blackbit

i have a entry in fstab

```
//axp/export    /mnt/axp        cifs            noauto,rw,user,credentials=/home/ahuemer/.cifspasswd    0 0
```

and the mount point is

```
drwxr-xrwx  2 root root    6 2008-03-27 21:11 axp
```

what do i have to do to be able to mount that as a user?Last edited by alex.blackbit on Sun Apr 13, 2008 10:17 pm; edited 1 time in total

----------

## coolsnowmen

have you read this:

http://smb4k.berlios.de/handbook/trouble_shooting_mounting_unmounting.html

----------

## pappy_mcfae

 *alex.blackbit wrote:*   

> i have a entry in fstab
> 
> ```
> //axp/export    /mnt/axp        cifs            noauto,rw,user,credentials=/home/ahuemer/.cifspasswd    0 0
> ```
> ...

 

Whenever I use a credentials argument, it never seems to work properly. Try putting in the name and password instead to see if it works that way. if so, then your system handles credential files as well as mine do; not at all.

As far as what's the problem with credential files...I have nary a clue.

Blessed be!

Pappy

----------

## alex.blackbit

well, interestingly, the thing with the credentials file works, when i run mount with the fstab entry as root

```
$ sudo mount /mnt/axp
```

----------

## pappy_mcfae

 *alex.blackbit wrote:*   

> well, interestingly, the thing with the credentials file works, when i run mount with the fstab entry as root
> 
> ```
> $ sudo mount /mnt/axp
> ```
> ...

 

How'd you get that to happen? I have ZERO luck with it.

I start all my samba shares manually after boot time using mount.cifs. I tried using smb4k, but it blew a hole in two KDE setups. I thought about having them auto-start, but there are times I don't want shares mounted. 

I tried the credentials file three different times, and it never worked. So, since I am the only one in the place that knows anything about Linux, it doesn't matter whether or not I put the name and password into the command that mounts the shares. However, I would like to get the credentials files working, just to be proper. 

Any hints you can offer would be greatly appreciated.

Blessed be!

Pappy

----------

## coolsnowmen

the first problem is moun.cifs needs suid

the second is that any user can only mount it on a mount point the [s]he owns.

If you only have one user mounting this, then that is not a problem

if you have more than one a sudoers line seems the appropriate solution.

(I have tested all this)

----------

## pappy_mcfae

True, unless you run as root, like yours truly. I think it has something to do with how I'm writing the file. The examples I have seen look this:

```
username=<name>

password=<password>
```

If that's wrong, please let me know.

Thanks

Blessed be!

Pappy

----------

## coolsnowmen

pappy_mcfae,

   There is nothing wrong with a credentials file like that (assuming you arn't actually using '<' '>'

   I was trying to help the original poster as I was playing with cifs myself.  I'ld also like to help solve your problem. 

I agree if you are root, my previous comment isn't of use to you.  But, I don't understand your problem.  What works, what doesn't work?  The line itself would help.  Have you tried the entire thing from the command line, try with --verbose to make sure things are read in correctly, forinstance, I think usenames/passwords with spaces are not supported

just fyi, I use this currently

from /etc/fstab

//ip.address.v.4/share   /mnt/mount_point      cifs            noauto,noacl,file_mode=0664,dir_mode=0775,gid=users,noperm,credentials=/etc/root_readable_creds

0 0

the credentials look like this:

username=myuser

password=mypass

I have net-fs/mount-cifs-3.0.28 installed, and the 24-r3 cifs module (latest gentoo stable)

----------

## pappy_mcfae

Thanks for the tips. I'll give them a try later on today. Sorry I don't quite have a solution for your problem, but I think you might have helped me with mine. For that, I thank you.   :Smile: 

Blessed be!

Pappy

----------

## alex.blackbit

sorry for the late reply.

the situation is clear now.

coolsnowmen, your hints lead to the solution.

mount.cifs gives varied error messages, depending on the exact situation.

with not owning the mount point and not SUID bit i got 

```
ahuemer@xeon ~ % mount /mnt/axp

mount error 1 = Operation not permitted

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

ahuemer@xeon ~ %
```

then with SUID but not owning the mountpoint (but with worldwrite bit!!!) i got

```
ahuemer@xeon ~ % mount /mnt/axp 

mount error: permission denied or not superuser and mount.cifs not installed SUID

ahuemer@xeon ~ %
```

with both corrected it works normally.

i think that the error message in the first case should also mention the need for SUID.

any comments welcome and many thanks for the help.

----------

