Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a staging server in my network running Ubuntu server 10.10, being my main development area. As I need to access the files in the Apache root from other computers in the network, I have setup samba with the following settings:

[www]
    comment = Apache root www
    path = /var/www
    writable = yes
    force user = root
    force group = root

On the host computer, running Ubuntu 10.10 desktop, I am trying to mount the drive with a bash file looking like below:

#!/bin/bash
sudo mount -t cifs //192.168.1.5/www /media/www/ -o username=myusername,password=mypassword,rw,iocharset=utf8,file_mode=0777,dir_mode=0777

What happens is that I get mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) thrown in my face whilst trying to execute the mount.

I've done exactly the same, with exactly the same smb.conf & mount-bash file on another computer in my network, but this just wont work.

What am I doing wrong? I am running out of ideas.

share|improve this question
1  
If someone wonders, I've run smbd restart after editing the /etc/samba/smb.conf file... –  Industrial Feb 27 '11 at 13:06
    
Did you check samba logs on server side (/var/log/samba/smbd.log or similar)? –  Olli Feb 27 '11 at 13:08
    
Yep - checked the log and the only thing that appears in the log is "[2011/02/27 14:16:53.770717, 0] printing/print_cups.c:108(cups_connect) Unable to connect to CUPS server localhost:631 - Connection refused" which I guess isn't related –  Industrial Feb 27 '11 at 13:20
    
Security in the smb.conf is set to user, if anyone cares –  Industrial Feb 27 '11 at 13:21
    
Well yes, CUPS message shouldn't relate to that in any way. –  Olli Feb 27 '11 at 13:34
add comment

1 Answer 1

up vote 0 down vote accepted

Basic troubleshooting:

  1. Connect with smbclient -U myusername //192.168.1.5/www and see what happens
  2. Do same from server (not from remote host)
  3. Check /var/log/samba/smbd.log and /var/log/samba/log.[remote address]
  4. Increase samba logging level and retry. You can do this by adding log level = 3 to your smb.conf (and either restarting or sending HUP to smbd).
share|improve this answer
    
Thanks for your reply Olli. I was able to try out smbclient as shown in your answer and found out that a "NT_STATUS_LOGON_FAILURE" were thrown. I ran sudo smbpasswd -a myuser and everything worked out after a smbd restart! Thanks a lot! –  Industrial Feb 27 '11 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.