LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 11-14-2009, 02:14 PM   #1
CADIT
LQ Newbie
 
Registered: Nov 2009
Location: Belfast Northern Ireland
Distribution: Debian Lenny
Posts: 7

Rep: Reputation: 0
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
 
Old 11-14-2009, 02:55 PM   #2
madmadmod
Member
 
Registered: Sep 2009
Distribution: Fedora, Red Hat
Posts: 52

Rep: Reputation: 18
what happens if you put the mount command in a script and run the script from a shell (not from crontab)?
 
Old 11-14-2009, 04:18 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,151

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by madmadmod View Post
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.
 
Old 11-14-2009, 10:07 PM   #4
Guyverix
Member
 
Registered: Nov 2008
Location: Washington State
Distribution: Mint
Posts: 31

Rep: Reputation: 2
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
 
Old 11-15-2009, 12:44 AM   #5
madmadmod
Member
 
Registered: Sep 2009
Distribution: Fedora, Red Hat
Posts: 52

Rep: Reputation: 18
@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
 
Old 11-16-2009, 04:04 AM   #6
CADIT
LQ Newbie
 
Registered: Nov 2009
Location: Belfast Northern Ireland
Distribution: Debian Lenny
Posts: 7

Original Poster
Rep: Reputation: 0
Smile 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
 
Old 11-20-2009, 02:48 PM   #7
TomFunke
LQ Newbie
 
Registered: Nov 2009
Location: Berlin, Germany
Distribution: CentOS, OpenBSD, Ubuntu, Feodora, LinuxMint, Android
Posts: 3

Rep: Reputation: 0
Workaround for mount.cifs error 13
delete linefeed after your password in the credential file
see also kbase.redhat.com/faq/docs/DOC-21451
 
  


Reply

Tags
cifs, denied, error, mount, permission


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 40 10-31-2012 08:50 AM
mount -t cifs permission denied by mount -t smbfs works fine humbletech99 Linux - Server 13 09-03-2009 10:17 AM
Help with mounting samba share: smbmount or mount.cifs error: permission denied wdli Linux - Server 1 08-11-2009 11:31 PM


All times are GMT -5. The time now is 05:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration