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

Re: Mounting a Windows Share



On 2016-01-02 at 16:15, Steve Matzura wrote:

> On Sat, 02 Jan 2016 15:00:31 -0500, The Wanderer 
> <wanderer@fastmail.fm> wrote:

>>> 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.
> 
> You're right. I knew they were missing, but the article that 
> instructed me on how to modify fstab didn't explain what the two 0's 
> at the end of the line are for, so I omitted them, hoping an error 
> message would give me a clue as to what I should put in their
> places.

The correct mount options are half of what you're actually asking about
in this thread, so we should settle those out by the time the thread is
done with.

For the "dump" and "pass" columns, in my experience 99% of the time they
can and should be left as zeroes. (This might be the default, I'm not
sure. I've always specified them anyway.)

>> 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.
> 
> I'm running it as root all right. I just now tried:
> 
> mount -t cifs //box/users2 /mnt/share -o username:"Steve Matzura"
> 
> and got back:
> 
> Username specified with no parameter

Try it with '-o username=' instead of '-o username:'.

Also, check lusrmgr.msc (or equivalent) on the Windows box, to make sure
you're using the actual internal Windows username; at least in my
experience, it's pretty rare for a Windows username to have a space in
it, although the _display_ name often will.

(Approximate GUI way to get there: right-click on "Computer" or "My
Computer" or your Windows version's equivalent, click "Manage", expand
"Local Users and Groups", click "Users". Win8 and/or Win10 may have
changed this, I haven't had much experience with them yet.)

>>> 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.)
> 
> Nothing that complicated. Just a default system username, which is
> my name, and no login password. I tried:
> 
> -o user="Steve Matzura",pass=""

In my experience, you don't need to specify the password in the command
line (although you might need it in the fstab for non-root mounting,
which would be a leak if the file is world-readable); if you don't
specify it, mount will prompt you for a password.

(The environment from which I most commonly do my *nix CIFS mounts has
older tools and doesn't accept '-o username=', but does accept '-o
user='. The latter is not recommended if the former works.)

-- 
   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: