CentOS – Write Only Shares (PART 20)

LAB 20: Samba Share – Write Only

Now we will share the students folder.

cd /data

vi /etc/samba/smb.conf

:set nu


Copy entire block to the end



Modify the block as follows:


comments = exchange information

path = /data/students

public = no (disallow guests access)

valid users = +students    (group students)

writeable = yes




cat /etc/samba/smbpasswd

smbpassword –a root (add root to samba password

service smb restart


On the server DC2012

Remove cached connection entry:

net use * /del /y

Use Windows Explorer and browse to the Linux server using UNC path:


Double-click on the Students folder, enter credentials as follows:

st1 / Pass1234

Try to create a sub-folder under the folder students; if you have error, you can see that

ls –l

shows that the users have rx only, we need to add ownership to the group as well. Enter the command:

chgrp students /data/students

chmod 775 –R /data/students/

Now on DC2012, try to add sub-folder and files under the folder students. This should be successful.

net use * /del /y

access \\DNSSRV\students as teachers. Teachers will not be able to access because this directory is for students only.

There are some basic SMB commands one should know as well. On the samba server, type:


Enter root password

findsmb (find smb server in the LAN)

smbclient –L DNSSRV

Enter root password to connect.