manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied
Hi,
This is my first post, hope someone can help.
I have a Windows 2003 SBS Server and a Debian Lenny 2.6.26-1-686 fileserver setup with samba connected on the active directory and all working fine.
I am trying to test scripting to use on other servers with a similar setup. So I manually run this command to mount a windows share...
I then run rsync and umount manually. All works fine the way I want.
My next step is I want this to run as a script in CRON, so I create a backup.sh file in /usr/local/bin/
--------------------------------------------
# mount network drive
/sbin/mount.cifs //windowsserver/share /mnt/share -o username=someuser,password=somepassword
# sync the network drive to local drive
rsync -avz /mnt/share /tmp
# unmount the network share
umount //mnt/share
---------------------------------------------
I am loged in as root and run # /usr/local/bin/backup.sh
and get the following error
fileserver:~# /usr/local/bin/backup.sh
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
I have also tried with DOMAIN/username and -o,username and with -o domain=DOMAIN,username etc etc
all files are up to date on standard debian lenny apt-get update/upgrade
the only difference that might be is I had to compile a new version of Samba to work correctly with SBS2003 Active Directory, but this issue shouldnt be anything to do with samba.
Hopefully someone can help
D
Have you tried the command with the -v option in your script so you can get some more verbose information from when it is trying to mount? I found an old post from someone else having this problem and they were able to compare what was being sent for authentication when using -v
The post is old, but it might assist in troubleshooting.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.