# mounting a remote file system problems

## SRC_DoD

so we have a samba directory setup at work named NetworkLab.  Here is what i've included into my fstab...

 *Quote:*   

> //*ip*/NetworkLab      /mnt/NetworkLab cifs    user,rw,domain=SAMBA,credentials=/home/*user*/.smbpassword 0 0
> 
> 

 

where .smbpassword contains

 *Quote:*   

> 
> 
> username=*username*
> 
> password=*password*
> ...

 

and CIFS has been compiled into the kernel.  as far as it has been explained to me this is all that is needed, however here is the message i get while trying to mount it

 *Quote:*   

> # mount /mnt/NetworkLab
> 
> mount: wrong fs type, bad option, bad superblock on //*ip*/NetworkLab,
> 
>        missing codepage or other error
> ...

 

and dmesg | tail says

 *Quote:*   

>  CIFS VFS: No username specified
> 
>  CIFS VFS: cifs_mount failed w/return code = -22
> 
> 

 

any ideas?

----------

## coplaniuk

Check the permissions on your credentials file (/home/*user*/.smbpassword according to your fstab).  It needs to be owned by root:root.  Recommend setting permissions to 600 as well:

```

% chown root:root /home/user/.smbpassword

% chmod 600 /home/user/.smbpassword

```

----------

## SRC_DoD

i thought of that and it still doesn't work.  i actually tried owning it as the user and root to no avail.  it seems it must be a problem with either the format of the file or just can't find it the file

----------

## coplaniuk

Just so that we can eliminate variables for trouble shooting...try sticking the username and password in the fstab for now.  If it works then, it's probably something with the file.  If not...then we know the external file has nothing to do with it.

----------

## SRC_DoD

i tried that and as it worked i settled for it.  however it still bugs me that specifying a password int he credentials doesn't work...

----------

## coplaniuk

I wonder if its something about the file location.  Maybe it needs to be in /etc for some reason.  Or maybe it needs to be in a directory that is owned by root:root...but I can't imagine why.

I don't have a setup to test whether that might be the case.  This is bugging me...so I hope we can get it fixed.

----------

## SRC_DoD

 *coplaniuk wrote:*   

> I wonder if its something about the file location.  Maybe it needs to be in /etc for some reason.  Or maybe it needs to be in a directory that is owned by root:root...but I can't imagine why.
> 
> I don't have a setup to test whether that might be the case.  This is bugging me...so I hope we can get it fixed.

 

i tried laying the file in /root/ i believe and that didn't help.  i'll try putting it in /etc

ok that didn't work, in /etc. 

 *Quote:*   

>  ~ $ ls -al /etc/.smbpassword
> 
> -rwxr-xr-x 1 root root 36 Jul 21 14:10 /etc/.smbpassword

 

so you can see the permissions

----------

## coplaniuk

Hmmm...I'm stumped.  

Sorry I couldn't help.

----------

## GEDIK

 *SRC_DoD wrote:*   

>  *coplaniuk wrote:*   I wonder if its something about the file location.  Maybe it needs to be in /etc for some reason.  Or maybe it needs to be in a directory that is owned by root:root...but I can't imagine why.
> 
> I don't have a setup to test whether that might be the case.  This is bugging me...so I hope we can get it fixed. 
> 
> i tried laying the file in /root/ i believe and that didn't help.  i'll try putting it in /etc
> ...

 

Installation of net-fs/cifs-utils will solve your problem

```

[I] net-fs/cifs-utils

     Available versions:  5.4 ~5.5-r1 {{ads +caps caps-ng creds upcall}}

     Installed versions:  5.4(19:33:24 25.7.2012)(caps -ads -caps-ng -creds -upcall)

     Homepage:            http://www.samba.org/linux-cifs/cifs-utils/

     Description:         Tools for Managing Linux CIFS Client Filesystems

```

----------

