Author Topic: mounting windows shares from Linux  (Read 3483 times)

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
mounting windows shares from Linux
« on: 07 May, 2008, 12:56:24 pm »
When I ran Ubuntu 7.10, this command:
Code: [Select]
sudo mount -t smbfs //<machine IP>/<share name> /<mountpoint> -o credentials=/home/<homedir>/.smbpassword,uid=1000,rwworked perfectly. Since upgrading to 8.04 last week, it doesn't, and I get this error:
Code: [Select]
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

I've tried mount -t cifs but I get the same error. What's going on? Help!
Pen Pusher

border-rider

Re: mounting windows shares from Linux
« Reply #1 on: 07 May, 2008, 12:58:28 pm »
What happens if you just sudo mount ?

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #2 on: 07 May, 2008, 01:03:48 pm »
What happens if you just sudo mount ?

pooter says "no" (same error)

Additional info:
I can get to the share using the "smbclient" command, so the "Not a directory" has left me baffled :-\.
Pen Pusher

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #4 on: 07 May, 2008, 01:12:50 pm »
This might help:

http://ubuntuforums.org/showthread.php?s=0c68cde20be13b96522a0414d8227e0c&t=741124&page=2

Thanks. I'd already tried the "nounix" option after doing some searching, ie:
Code: [Select]
sudo mount -t smbfs //<machine IP>/<share name> /<mountpoint> -o credentials=/home/<homedir>/.smbpassword,uid=1000,rw, nounixSame error, unfortunately.
Pen Pusher

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: mounting windows shares from Linux
« Reply #5 on: 07 May, 2008, 01:16:28 pm »
I would try moving the -o bit to BEFORE the mount points but after the -t part, thus:

sudo mount -t cifs -o credentials=/home/<homedir>/.smbpassword,uid=1000,rw,nounix //<machine IP>/<share name> /<mountpoint>

Oh and remove the space from before the nounix, mount can be funny about the order and whitespaces in the -o options.  I would stick with -t cifs though as smbfs is deprecated (YAY the first time I have needed to use deprecated on a non-tech forum! :) )
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: mounting windows shares from Linux
« Reply #6 on: 07 May, 2008, 01:18:09 pm »
It might also be worth adding the uid and gid to the -o part
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #7 on: 07 May, 2008, 01:24:12 pm »
Here's the output from my syslog/auth.log:

Code: [Select]
May  7 13:22:16 mob-desktop1 sudo: PAM unable to dlopen(/lib/security/pam_smbpass.so)
May  7 13:22:16 mob-desktop1 sudo: PAM [error: /lib/security/pam_smbpass.so: cannot open shared object file: No such file or directory]
May  7 13:22:16 mob-desktop1 sudo: PAM adding faulty module: /lib/security/pam_smbpass.so
May  7 13:22:16 mob-desktop1 sudo: pam_unix(sudo:session): session opened for user root by mob(uid=0)
May  7 13:22:16 mob-desktop1 sudo: pam_unix(sudo:session): session closed for user root
Pen Pusher

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #8 on: 07 May, 2008, 01:24:48 pm »
It might also be worth adding the uid and gid to the -o part

Just remind me how I look that up ;)
Pen Pusher

Re: mounting windows shares from Linux
« Reply #9 on: 07 May, 2008, 01:33:05 pm »
id -a username

$ id -a alexg
uid=427(alexg) gid=101(dev) groups=101(dev)
"Yes please" said Squirrel "biscuits are our favourite things."

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: mounting windows shares from Linux
« Reply #10 on: 07 May, 2008, 01:36:00 pm »
uid can be found in /etc/passwd, gid in /etc/group.

It would appear though, from your logs that you have a missing or corrupt /lib/security/pam_smbpass.so, which should come as part of samba-common.

Try this :
# sudo find / -name pam_smbpass.so

You may find that it is actually somewhere else, the most common problem I have come across is that the pam modules are actually in /lib64/security, but the files in /etc/pam.d have not been properly updated to reflect this.
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: mounting windows shares from Linux
« Reply #11 on: 07 May, 2008, 01:43:05 pm »
This looks like it might be your solution:

https://bugs.launchpad.net/ubuntu/+source/pam/+bug/218110

I take it that this is an upgraded box, not a clean install?
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #12 on: 07 May, 2008, 02:09:57 pm »
This looks like it might be your solution:

https://bugs.launchpad.net/ubuntu/+source/pam/+bug/218110

I take it that this is an upgraded box, not a clean install?

Upgraded, yes.

I installed libpam-smbpass but so far no success :(.
Pen Pusher

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
[solved] mounting windows shares from Linux
« Reply #13 on: 20 May, 2008, 12:42:26 pm »
Found the fix, sort of by accident. If I put
Code: [Select]
-o user=<myUserName>,pass=<myPassword> in the command string instead of using the credentials file I get this error:
Code: [Select]
bash: <someCharsInPassword>: event not found
Ah! It doesn't like the password, or something about the password being passed from an external file. It's OK, however, if I do this:
Code: [Select]
-o user=<myUserName>,pass='<myPassword>' or if I leave out the password and type it in the terminal when prompted.
Pen Pusher

Re: mounting windows shares from Linux
« Reply #14 on: 20 May, 2008, 12:44:26 pm »
Does your password contain any of the following symbols:

- = , $

?
"Yes please" said Squirrel "biscuits are our favourite things."

Woofage

  • Tofu-eating Wokerati
  • Ain't no hooves on my bike.
Re: mounting windows shares from Linux
« Reply #15 on: 20 May, 2008, 01:13:30 pm »
Does your password contain any of the following symbols:

- = , $

?

!
- which it obviously doesn't like! Which is odd, because it was OK before ???
Pen Pusher

bobajobrob

Re: mounting windows shares from Linux
« Reply #16 on: 20 May, 2008, 01:15:08 pm »
Quote
mount error 20 = Not a directory

Not the most helpful error message either.

Re: mounting windows shares from Linux
« Reply #17 on: 20 May, 2008, 01:27:14 pm »
Does your password contain any of the following symbols:

- = , $

?

!
- which it obviously doesn't like! Which is odd, because it was OK before ???

Some non-alphanumeric characters have special meanings on the command lines:-

Try the following:-

echo !2

compared to:

echo '!2'

Then (if you don't mind your password being in your shell history file) try:

echo your_password

If the output is not what you expected then it's because part of it is being expanded by the shell.

[EDIT] Ah yes, just seen you were getting this:-

Code: [Select]
bash: <someCharsInPassword>: event not found

Which explains it.

The shell replaces !X with whatever is entry 'X' in the shell's history. i.e.

$ history | grep 11
   11  ./pamtest.solaris2 -user wibble
$ echo abc!11def
echo abc./pamtest.solaris2 -user wibbledef
abc./pamtest.solaris2 -user wibbledef

If I try something that doesn't exist in the shell's history, I get:-

$ echo !abcd
bash: !abcd: event not found
"Yes please" said Squirrel "biscuits are our favourite things."