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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
I am loged in as root and run # /usr/local/bin/backup.sh
and get the following error
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
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.