Why I can not login my shared folder under samba + CentOS 7

sincos2007

New member
Joined
Dec 1, 2016
Messages
7
Hi,

I install samba by:

sudo yum install samba.x86_64

I edit /etc/samba/smb.conf by adding follows:

[data]
comment = data
path = /home/myname/data
valid users = test1
write list = test1
create mask = 0754
sync always = Yes
; hide dot files = yes
; writeable = no
; browseable = yes

Then take effect my config:

service smb restart

I create shared folder:

cd ~
mkdir data

I create user:

useradd test1
smbpasswd -a test1
<then password>


Then I open my file manager and input:

smb://127.0.0.1

A login form popup, I enter username: test1 and the password, the login form returns again, I found I can not enter the shared folder by that account.

Thanks
 
Hello,

Though the subject is rather offtopic for these forums, I'd guess that /home/myname/data is not owned by user test1, and the user test1 has no permissions either to read or to write into /home/myname/data.
 
Hi Richard,

As I post before, I have done it:

useradd test1
smbpasswd -a test1

And in /etc/passwd:

test1:x:1001:1001::/home/test1:/bin/bash

Thanks
 
Hi Alex,

In my system:

cd ~
ls -ld data/

drwxrwxr-x. 3 test1 myname 26 12月 2 00:20 data/

Thanks
 
I found that if I create a folder under / as my shared folder(for example: /data), the samba work. If the shared folder is /home/myname/data, it doesn't work.
 
Code:
[COLOR=#333333]drwx------. 16 myname myname 4096 12月 2 01:06 /home/myname

nobody but user "[/COLOR]myname" has permissions to access the folder. That's it.
 
Back
Top