permission denied when mounting shares locally - SOLVED

peaeater
Posts: 7
Joined: Fri Jan 14, 2011 11:12 am

permission denied when mounting shares locally - SOLVED

Postby peaeater » Mon Jan 17, 2011 8:19 pm

I'm having trouble using the mount_shares_locally script, as I get an error (13) Permission Denied on each share. I've double-checked that my credentials in .smb_credentials are correct, that my username is correct in /etc/init.d/mount_shares_locally, and I even eventually added a --verbose option to the script to make sure the credentials were being passed in correctly. I also tried entering credentials directly in the script instead, but no diff.

I'm absolutely certain that the user/pass combination is correct, so suspected that the domain value (HOME) must be invalid. My amahi.org control panel reports my domain is home.com, however. So I don't know. I'm very, very stuck.

Contents of /home/ptyrrell/.smb_credentials:

Code: Select all

username=ptyrrell password=notreallymypw domain=HOME
Contents of /etc/init.d/mount_shares_locally:

Code: Select all

#!/bin/sh # ### BEGIN INIT INFO # Provides: mount_shares_locally # Required-Start: $network $local_fs $remote_fs smb mysqld # Required-Stop: $network $local_fs $remote_fs smb # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: mount Samba shares locally ### END INIT INFO username="ptyrrell" if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi start () { uid=`id -u $username` gid=`id -g $username` echo -n $"Mounting Samba shares locally: " mkdir -p /mnt/samba/ cd /mnt/samba/ mysql -u root -phda -e "select comment from shares" hda_production | grep -v "^comment$" | xargs -d "\n" mkdir -p ls -1 | while read d; do /sbin/mount.cifs "//127.0.0.1/$d" "$d" --verbose -o credentials=/home/${username}/.smb_credentials,uid=${uid},gid=${gid},file_mode=0660,dir_mode=0770,hard,_netdev done touch /var/lock/subsys/mount_shares_locally success $"$base startup" echo return 0 } stop () { echo -n $"Unmounting locally mounted Samba shares: " /bin/umount -l /mnt/samba/* rm -f /var/lock/subsys/mount_shares_locally success $"$base shutdown" echo return 0 } restart () { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 ;; esac exit $?
Result of mount_shares_locally start:

Code: Select all

[root@SEAGLASS ptyrrell]# service mount_shares_locally start Mounting Samba shares locally: Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Backups,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Books,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Docs,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Gaming,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Movies,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Music,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Pictures,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Ripplebliss,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Domain HOME mount.cifs kernel mount options: unc=//127.0.0.1\Software,user=ptyrrell,domain=HOME,ver=1,credentials=/home/ptyrrell/.smb_credentials,file_mode=0660,dir_mode=0770,hard,_netdev,uid=500,gid=100,ip=127.0.0.1,pass=******** mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

SOLVED: I needed to add my username to the samba user database like so:

Code: Select all

smbpasswd -a ptyrrell

Vertigo500
Posts: 54
Joined: Tue Mar 22, 2011 7:09 am

Re: permission denied when mounting shares locally - SOLVED

Postby Vertigo500 » Sun Oct 30, 2011 11:32 am

pdb_get_group_sid: Failed to find Unix account for vertigo500
pdb_get_group_sid: Failed to find Unix account for vertigo500

Was what i got after doing this. Why does everything have to be so hard?

Any tips?

Who is online

Users browsing this forum: No registered users and 10 guests