Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-14-2009, 02:14 PM
|
#1
|
LQ Newbie
Registered: Nov 2009
Location: Belfast Northern Ireland
Distribution: Debian Lenny
Posts: 7
Rep:
|
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...
# /sbin/mount.cifs //windowsserver/share /mnt/share -o username=someuser,password=somepassword
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
|
|
|
11-14-2009, 02:55 PM
|
#2
|
Member
Registered: Sep 2009
Distribution: Fedora, Red Hat
Posts: 52
Rep:
|
what happens if you put the mount command in a script and run the script from a shell (not from crontab)?
|
|
|
11-14-2009, 04:18 PM
|
#3
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by madmadmod
what happens if you put the mount command in a script and run the script from a shell (not from crontab)?
|
Um, not to be picky, but did you read the post? The last failure was when CADIT ran the script from a terminal as "root."
Anyhow, I can't see why the reported problem happens. Sorry.
|
|
|
11-14-2009, 10:07 PM
|
#4
|
Member
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 36
Rep:
|
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.
http://fedoraforum.org/forum/archive...p/t-41910.html
|
|
|
11-15-2009, 12:44 AM
|
#5
|
Member
Registered: Sep 2009
Distribution: Fedora, Red Hat
Posts: 52
Rep:
|
@PTrenholme: sorry, you are right. i did not read the post carefully enough.
Guyverix is right. try the -v or even -vvv option. I did cifs mounts on AIX and had some problems with '*' in the password in beginning.
good luck
|
|
|
11-16-2009, 04:04 AM
|
#6
|
LQ Newbie
Registered: Nov 2009
Location: Belfast Northern Ireland
Distribution: Debian Lenny
Posts: 7
Original Poster
Rep:
|
Thanks for all your help - its now working
Thanks for your help, all is now working. The following is what has changed
OLD COMMAND
# /sbin/mount.cifs //windowsserver/share /mnt/share -o username=someuser,password=somepassword
NEW COMMAND THAT WORKS IN MY SCRIPT
# mount.cifs //serverip/share /mnt/share -o ip=serverip,user=someuser,pass=somepassword ,dom=domainname
I also had a problem with my # umount //mnt/share it should have been # umount /mnt/share
Thanks
|
|
|
11-20-2009, 02:48 PM
|
#7
|
LQ Newbie
Registered: Nov 2009
Location: Berlin, Germany
Distribution: CentOS, OpenBSD, Ubuntu, Feodora, LinuxMint, Android
Posts: 4
Rep:
|
Workaround for mount.cifs error 13
delete linefeed after your password in the credential file
see also kbase.redhat.com/faq/docs/DOC-21451
|
|
|
All times are GMT -5. The time now is 08:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|