Cannot permanently mount Windows Shares

New to Debian (Or Linux in general)? Ask your questions here!

Cannot permanently mount Windows Shares

Postby Acans » 2018-03-02 05:23

Hi all,

I'm quite new to linux and am trying to mount my windows network drives on boot to my new Debian 9.3.0

Currently, I can mount the drive to the directory I created /media/downloads after boot using the following command

sudo mount.cifs //192.168.1.1/Downloads /media/downloads -o user=guest

192.168.1.1 being my windows server, that share has sharing enabled for everybody on my home network with read/write permissions. However I'd like to have this mounted every time Linux starts. I've tried the following in /etc/fstab/

//192.168.1.1/Downloads /media/downloads cifs guest,uid=1000,iocharset=uft8 0 0

However after using mount -a it returns the following error

mount error(13): Permission denied.

Quite confused as to why it can't be auto mounted on boot but can be temporary mounted by using the before mentioned command.

I've done some googling of Linux Questions, however it seems everybody else is being smart and requiring a username/password to access to the share instead of just allowing everybody on the home network read/write. So I guess the question is can I get away without requiring a username/password on the windows machine (that currently doesn't have an admin password).



Also those commands and recommendations I got from this link, https://wiki.ubuntu.com/MountWindowsSharesPermanently including the troubling shoot too. I've been told it should have worked since ubuntu comes from Debian but it hasn't :(.
Acans
 
Posts: 2
Joined: 2018-03-02 05:05

Re: Cannot permanently mount Windows Shares

Postby bw123 » 2018-03-02 20:47

Things can change, that page says last edited in 2014 so there may be other ways to do it now. Since it works with mount -o user=guest have you thought about using user=guest instead of just 'guest' in the fstab? The same article you linked says to try username=guest,password= later down in the middle, under "doesn;t mount on boot'

Hang in there, it's tough being new and trying to find accurate documentation. The best place IMO will always be the man page on your machine, so try man cifs or apropos samba and browse a few pages listed there.

good luck,
User avatar
bw123
 
Posts: 3572
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Cannot permanently mount Windows Shares

Postby cds60601 » 2018-03-03 04:23

Hi there!

While I'm not mounting a Windows share, I am doing something similar on my home network.

Server: Debian 9-STABLE <-- Samba Server
WS1: Debian 9-STABLE <-- This is the pertinent one outline below
WS2: Debian 9-STABLE
WS3: Windows 7
WS4: Raspbian (Rasberry Pi)

So here is what I have on my Debian workstation in /etc/fstab

# Eagle project folder
//earth/chris/Projects/eagle /home/chris/eagle cifs credentials=/home/chris/.smbcredentials,uid=1000,iocharset=utf8,noperm 0 0

The file /home/chris/.smbcredentials is a simple text file chmod'd to 600 with the format:
username=xxxxx
password=xxxx

The above use of a file for creds (while not the most secure to a point) it certainly beats having a username/password in fstab (if indeed you need to use one).
I have many shares setup and as you already know, mount -a (either sudo or root) mounts them all etc.

This works for me very well, and again, while it is not like your setup, I posted this with the hopes that you can find crumbs that will lead you
to successfully setting up your environment - of course, YMMV.

Cheers
Chris
Yeah, 220, 221. Whatever it takes.
Server: Debian 9 (Stretch) Workstation: Archlinux
User avatar
cds60601
 
Posts: 136
Joined: 2017-11-25 05:58

Re: Cannot permanently mount Windows Shares

Postby Acans » 2018-03-03 06:29

Hi there,

I gave up on guest mounting and tried password protected mounting, putting the details in the fstab and it works fine now. I'm now in the process of remove the details from the fstab in a similar manner to what you've done.

Ty for the tip!
Acans
 
Posts: 2
Joined: 2018-03-02 05:05


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable