2

Hi,

I have installed Samba and CIFS and all that, followed a bunch of tutorials, but still I can't access a share in the separate Windows 7 machine. Before I could access a share in Ubuntu from Windows, but although now I can't for whatever reason; the error of the attempt to mount the Windows share is the same: 13, asking for credentials (the computer with Windows is off now, but I can add the exact error message later).

In /etc/fstab I have:

# ... (help info) ...
# <file system>                            <mount point>      <type>     <options>                                  <dump> <pass>
# ... (mounting points that don't matter for the question) ...
//192.168.1.2/C\:/Users/Public/Documents   /srv/Z\:/          cifs       user=guest,password=,uid=1000,iocharset=utf8   0      0

I also tried options such as username=guest,uid=1000,iocharset=utf8 and guest,uid=1000,iocharset=utf8, which, of course, don't work. What user am I supposed to use? (user=user; username=user; my credentials in the Windows and Ubuntu machines do not work, at least with the syntax I tried - similar to this).

Even if this worked it's not actually what I want. I wanted to setup an authentication for any one trying to access the drive (it's currently 777, for the Linux share as well) and put a limit/quota on the share's use (as I see Z:on Windows, it allows for the entire C:drive to be filled).

Thank you in advance. I'd be glad if you suggested a way to do this even without the last paragraph.

  • Also note I already tried a bunch of tutorials, please don't redirect me to some "catch-all" tutorial on Samba. – JMCF125 Oct 27 '13 at 21:46
1

The mount.cifs man page is pretty handy here. Under the Options section:

  • user=arg specifies the username to connect as. If this is not given, then the environment variable USER is used. This option can also take the form "user%password" or "workgroup/user" or "workgroup/user%password" to allow the password and workgroup to be specified as part of the username.

  • password=arg specifies the CIFS password. If this option is not given then the environment variable PASSWD is used. If the password is not specified directly or indirectly via an argument to mount, mount.cifs will prompt for a password, unless the guest option is specified.

    Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.

In short, the credentials Windows (or the Samba server if we're not talking about Windows) is expecting, not your local Ubuntu credentials.


On a sidebar, your paths in your fstab string look completely whack. I would suggest:

//192.168.1.2/share_name /srv/z/

If you don't know what the share name is, use smbclient:

smbclient -I 192.168.1.2 -Uusername

And that should list the resources. It also lets you test which username you should be using.

And /srv/z/ needs to exist before you can mount something on it. If it doesn't exist, create it.

| improve this answer | |
  • I thought I needed to specify the location of the share in Windows' file system. And when I execute smbclient -I 192.168.1.2 -Uusername it returns help on the use of smbclient. /srv/Z\: does exist. – JMCF125 Oct 28 '13 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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