Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot permanently mount Windows Shares

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Acans
Posts: 4
Joined: 2018-03-02 05:05

Cannot permanently mount Windows Shares

#1 Post by Acans »

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

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Cannot permanently mount Windows Shares

#2 Post by bw123 »

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,
resigned by AI ChatGPT

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 706
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 129 times
Been thanked: 60 times

Re: Cannot permanently mount Windows Shares

#3 Post by cds60601 »

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
Supercalifragilisticexpialidocious

Acans
Posts: 4
Joined: 2018-03-02 05:05

Re: Cannot permanently mount Windows Shares

#4 Post by Acans »

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!

Post Reply