What are the Requirements of SAMBA Server?

RPM packagesSAMBA, SAMBA-common, SAMBA-client
Daemonssamba, nmbd
Script/etc/init.d/smb and /etc/init.d/nmb
Configuration file/etc/samba/smb.conf
File systemCIFS (common internet file system)
Port Number187 (name service), 139(session service)
138(datagram), 445(Microsoft distribution system)

 

How to Configure the SAMBA Server?

Server configuration:

• Check whether the package is installed or not.

[root@sys1 ~]# rpm -q samba

 

If above command returns the no output then install the package.

[root@sys1 ~]# yum install samba

 

• Choose a directory or create the directory you want to share.

[root@sys1 /]# ls
bin boot devetc home lib lib64 lost+found media miscmnt net opt oracleproc repo root sbinselinuxsrv sys tmpusrvar
[root@sys1 /]# cd /oracle/
[root@sys1 oracle]# ls
[root@sys1 oracle]# touch 1  2  3  4  5
[root@sys1 oracle]# ls
1  2  3   4   5

 

• Configure the /oracle folder to be shared over the network as follows.

[root@sys1 /]# chcon -t samba_share_t /oracle/
[root@sys1 /]# ls -ldZ /oracle/
drwxrwxrwx. rootroot unconfined_u:object_r:samba_share_t:s0 /oracle/

 

• Create a user or use an existing user who can use as a samba user and add that user as samba user.

[root@sys1 ~]# useradd raj
[root@sys1 ~]# smbpasswd -a raj
New SMB password:
Retype new SMB password:
Added user raj.

 

• To check all the SAMBA users on the system.

[root@sys1 ~]# pdbedit -L raj:500:

 

• Go to the samba configuration file /etc/samba/smb.conf

Go to last page last line and edit the entries as follows

[root@sys1 ~]# vi /etc/samba/smb.conf
[oracle]
comment = public staff
path = /oracle
valid users = raj
read only = No
guest ok = Yes
printable = Yes
print ok = Yes

 

• Test the errors in the configuration file as follows.

[root@sys1 ~]# testparm
Load smbconfig files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[oracle]"
Unknown parameter encountered: "host allow"
Ignoring unknown parameter "host allow"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

 

• Now restart the smb and nmb services.

[root@sys1 ~]# servicesmb restart
Shutting down SMB services:                                [ OK ]
Starting SMB services:                                     [ OK ]
[root@sys1 ~]# servicenmb restart
Shutting down NMB services:                                [ OK ]
Starting NMB services:                                     [ OK ]

 

• Turnoff the fire walls in order to accept the files to transfer.

[root@sys1 /]# serviceiptables stop
[root@sys1 /]# serviceiptables status
iptables: Firewall is not running.

 

Topics Summary