admin Posted on 11:34 pm

How to configure SAMBA on a Linux server

Step by step guide to configure SAMBA on a LINUX server.

This is for network administrators experienced in configuring and managing LINUX servers who want to know how to set up a SAMBA file server the right way step by step.

In this step-by-step tutorial, I’ll show you how to create a shared folder on a Linux server and share it so that users on Microsoft Windows workstations can access it on a local internal network.

In this tutorial, I’m going to make the folder called “shared folder” and allow everyone to access the folder and printer on the network with the Linux server.

This is a basic guide to setting up a Samba workgroup file server. I’ll cover how to build and configure a samba PDC – Primary Domain Controller in another tutorial for more experienced network administrators.

STEP 1 Open the samba configuration file using a Unix text editor. I like NANO because it is very easy to use. Below are the commands I used to accomplish this task.

[root@localhost ~]# cd /etc [root@localhost etc]#cd samba [root@localhost samba]# nano smb.conf

Ok, now we are at the smb.conf file. Now delete all the text in the configuration file. Now copy and paste the text below… after that, press the control and X buttons on your keyboard to exit the NANO text editor. Then press the Y button and lastly press the ENTER button. We are now back at the command prompt and our samba configuration file is edited and saved.

[global] workgroup=workgroup server string=My Linux file server hosts allow=192.168. 127. log file = /var/log/samba/%m.log security = user netbios name = SAMBA SERVER encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF= 8192

[shared folder] comment=My home directory browserable=yes writable=yes public=yes read only=no

[printers] path = /var/spool/samba public = yes guest OK = yes printable = yes browsable = yes writable = yes read only = no

STEP 2 We have to create a user account on the Linux server itself, then we will create a samba user on top of the Linux user account.

[root@localhost ~]# user add chris [root@localhost ~]# passwd chris Changing the password for user chris. New UNIX Password: Retype the new UNIX password: password: all authentication tokens updated successfully. [root@localhost ~]# smbpasswd -a chris New SMB Password: Retype the new SMB password: getsmbfilepwent: malformed password entry (no:) mod_smbfilepwd_entry: malformed password entry (no:) [root@localhost ~]#

STEP 3 We have to start the SAMBA service. It may have started already or it may not… so let’s check and see.

[root@localhost ~]# service smb status smbd is stopped nmbd is stopped [root@localhost ~]#

The samba service is not running, so let’s start it.

[root@localhost ~]# service smb start smbd (pid 4267 4266) is running… nmbd (pid 4271) is running… [root@localhost ~]#

Now let’s verify that the service is running

[root@localhost ~]# smb service status smbd (pid 4267 4266) is running… nmbd (pid 4271) is running… [root@localhost ~]#

STEP 4 Reboot your Windows XP workstations, then go to network “my network places” and then go to “workgroup computers”. You will see a computer there called “My Linux File Server”. You can manually assign a local drive letter to this folder or write a login script in the same way you would when connecting to a Microsoft file server: shared folder. Double click on that computer and you will be prompted for a username and password. Use the username and password you chose in step 2. You will now see a folder called “shared folder”. You can copy and paste data into this folder just like a Windows file server.

Leave a Reply

Your email address will not be published. Required fields are marked *