LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   samba "Access is denied" problem (https://www.linuxquestions.org/questions/linux-newbie-8/samba-access-is-denied-problem-741109/)

eduardbareev 07-18-2009 10:35 PM

[solved] samba "Access is denied" problem
 
Code:

[root@fedoravmhelm samba]# vim smb.conf

[global]
        workgroup = WRKGRP
        map to guest = Bad User
        usershare allow guests = Yes
        security = user
        log level = 10

[srv]
        comment = server base
        inherit acls = No
        path = /srv/www
        read only = No
        guest ok = yes
        browseable= Yes
        public = yes

[root@fedoravmhelm samba]# chmod 777 /srv/ -R

[root@fedoravmhelm samba]# chown eduard /srv/ -R

[root@fedoravmhelm samba]# smbpasswd eduard
New SMB password:
Retype new SMB password:

[root@fedoravmhelm samba]# ls -all /srv/www/
total 12
drwxrwxrwx. 3 eduard root 4096 2009-07-13 00:19 .
drwxrwxrwx. 4 eduard root 4096 2009-07-19 08:43 ..
drwxrwxrwx. 4 eduard root 4096 2009-07-13 08:44 sites

[root@fedoravmhelm samba]# /etc/init.d/iptables stop
iptables: Flushing firewall rules:                        [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                              [  OK  ]

[root@fedoravmhelm log]# echo '' > /var/log/samba/log.smbd

[root@fedoravmhelm log]# /etc/init.d/smb start
Starting SMB services:                                    [  OK  ]

[root@fedoravmhelm samba]# cp /var/log/samba/log.smbd /var/log/samba/log.smbd_after_start

Here i trying to access to my share from Vista box. Windows shows me my share "srv", but on double click it says me that "Access is denied".
Code:

[root@fedoravmhelm samba]# cp /var/log/samba/log.smbd /var/log/samba/log.smbd_after_try_to_acces
Logs are very long, if this can help - placed here: http://bareev.ru/temp/samba/

Code:

[root@fedoravmhelm samba]# uname -a
Linux fedoravmhelm 2.6.29.4-167.fc11.i686.PAE #1 SMP Wed May 27 17:28:22 EDT 2009 i686 i686 i386 GNU/Linux

I need help, thanks.

stress_junkie 07-18-2009 10:45 PM

http://www.linuxquestions.org/questi...9/#post3205636

eduardbareev 07-18-2009 11:43 PM

Quote:

Originally Posted by stress_junkie (Post 3612369)

I add to C:\Windows\System32\drivers\etc\hosts:
192.168.1.204 fedoravmhelm.workgroup fedoravmhelm

C:\Windows\System32\drivers\etc\lmhosts.sam
192.168.1.204 fedoravmhelm.workgroup fedoravmhelm #PRE

/etc/hosts
192.168.1.111 edik-pc-vista.workgroup edik-pc-vista

/etc/samba/lmhosts
192.168.1.111 edik-pc-vista.workgroup edik-pc-vista #PRE

But problem still here.

eduardbareev 07-18-2009 11:43 PM

Does anybody knows is this problem related to following lines in log?

Code:

[2009/07/19 07:22:56, 10] passdb/pdb_smbpasswd.c:getsmbfilepwent(501)
  getsmbfilepwent: LM password for user eduard invalidated

And what this means?
These lines appears in log immediately after samba starts (before i try to access share).

stress_junkie 07-19-2009 06:43 AM

The Lan Manager password for eduard is not valid.

When you create a Samba user you need to create a Samba user password. You do this with smbpasswd.

Code:

smbpasswd

eduardbareev 07-19-2009 07:14 AM

Quote:

Originally Posted by stress_junkie (Post 3612613)
The Lan Manager password for eduard is not valid.

When you create a Samba user you need to create a Samba user password. You do this with smbpasswd.

Code:

smbpasswd

Look at the first message, i already create password using

Code:

[root@fedoravmhelm samba]# smbpasswd eduard
New SMB password:
Retype new SMB password:

Or this is not enough?

wisdom 07-19-2009 12:38 PM

If you have SELinux runing, you might want to check that its not blocking access to your shared folder, also i notice this in the log when the start to process and after the srv folder is been process
Quote:

[2009/07/19 07:22:56, 7] param/loadparm.c:lp_servicenumber(9043)
lp_servicenumber: couldn't find homes
not sure what it is but somethin you might want to check out, also can you access the samba share without a user account by chaning the "security = user" to "security = share", and try see if you can access first as a guest.

eduardbareev 07-19-2009 06:38 PM

[solved] samba "Access is denied" problem
 
Quote:

Originally Posted by wisdom (Post 3612842)
If you have SELinux runing, you might want to check that its not blocking access to your shared folder, also i notice this in the log when the start to process and after the srv folder is been process

not sure what it is but somethin you might want to check out, also can you access the samba share without a user account by chaning the "security = user" to "security = share", and try see if you can access first as a guest.

Now i just reinstalled samba and switched to "security = share" mode and make my share completely public, and it works!!! This acceptable for me.

I think you are right, important point is selinux. Now i know that in fedora it is absolutely REQUIRED to follow SELINUX NOTES section of smb.conf. Even in share mode is need to do chcon -t samba_share_t /share_folder_path for every directory you want to share. So old rule works - read manuals first:)

Thanks for all for help!


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