[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mounting a Windows Share



On 2016-01-02 at 14:47, Steve Matzura wrote:

> I have a Windows machine called 'box' with a directory called
> 'users' which is shared publicly with no access username or password
> as 'users2'. On my Jessie system, I created the mount point
> successfully:
> 
> mkdir -p /mnt/users

I presume that the user as which you are attempting to run the later
mount command has write and execute permission on this new directory.

> I then installed the cifs-utils package as instructed by a Website
> with a fairly up-to-date article on how to do all of this.
> 
> In /etc/fstab, as directed by the same article, I have placed the
> line:
> 
> //box/users2 /mnt/users cifs

That looks incomplete to me; it doesn't seem to specify the mount
options, or the usual zero values for the "dump" and "pass" columns.
This may be valid fstab syntax, but it's not a variant I remember having
seen.

> I am now trying to mount the Windows share like this:
> 
> mount -t cifs //box/users2 /mnt/users

As which user?

If you're running that command as root, the fstab entry should not be
necessary; if you're running it as non-root, IIRC the "specify both
mount point and device to mount" will be rejected as "only root can do
that". Either way, this doesn't look quite right.

> The system responds:
> 
> mount error(13): Permission denied
> 
> Is there a default username and password I'm supposed to use, like
> maybe the Windows network password, or something else perhaps?

You most likely need the username and password of a user account on the
Windows box which can access that directory; you may also need to
configure the Windows share to specifically grant that user account
access to the share. With that done, you will need to specify those
credentials in the mount command, with the '-o user=' option.

(Technically what you need is a user account on the appropriate
_domain_, but for a non-domain-joined Windows computer the "domain" is
the name of the computer, and AFAIK does not need to be specified
separately. If this computer _is_ domain-joined and you log in to it
with a domain account, you will probably need to specify the domain in
the mount command as well.)


I routinely mount Windows-server CIFS shares on my work laptop with
commands like:

mount -t cifs -o user=username,domain=SHORTDOMAIN //server/sharename
/mnt/cifs/sharename

where 'username' is the name of the user account which I use when
logging on to the Windows machine, and SHORTDOMAIN is the all-caps name
of the Windows domain, analogous to the "workgroup" name (and not to be
confused with the dotted hierarchical name).

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: