Samba: How do you install and set up Samba in linux? [Redhat Enterprise(RHEL), CentOS, Fedora]
Setting up Samba “can” be complicated at times. Especially if you are looking for instructions online where there are WAY too many tutorials which go in to details about what configuration does what, etc. Well, this post is nothing like that. Here I just show you quick and easy way to install Samba, configure it, and set up the drive letter on your XP/Vista. NOTE: for using Samba with Vista, please see my previous post in which I talk about changing settings in Vista so you can connect to your Samba share: Windows Vista Installation
NOTE: This set up is very “open” and should not be used on servers which are facing the world. This is for private network where you trust all the computers and its users.
Installing Samba (using yum on CentOS and Fedora): yum install samba
Installing Samba (using rpm):
- Obtain Samba rpm from rhn.redhat.com
- rpm -ivh samba*.rpm
Configuring Samba:
cd /etc/samba
mv smb.conf smb.conf.backup
vi smb.conf
Paste content below in to your vi:
[global]
workgroup = wrkgrp
netbios name = smbserver
security = SHARE
load printers = No
default service = global
path = /home
available = No
encrypt passwords = yes
[share]
writeable = yes
admin users = smbuser
path = /home/share
force user = root
valid users = smbuser
public = yes
available = yes
save and exit
adduser smbuser #add unix account
passwd smbuser #set unix account password
smbpasswd -a smbuser #lets create same user account on samba
<put same password as your unix account password>
/etc/init.d/smb restart
Now let us setup drive letter on our Windows so we can easily access these files.
Start -> run -> cmd <enter>
At the prompt type: net use z: \\ip_of_your_samba_server\share /user: smbuser password_you_assigned
That is it! At this point you have successfully set up Samba under Linux and are now successfully connected to your share from your Windows machine.

(8 votes, average: 4.25 out of 5)

Worked like a champ. Had it configured in less then 10 minutes
Thank you very much. Your Instructions were excellent.
Thank you.
Nick
cd /etc/samba
mv smb.conf smb.conf.backup
vi smb.conf
Quick update, you might wanna do a CP instead of an MV, or the above series of commands won’t work.
Michael, yes they do. done it many times.
Great instructions!
I’m having password issues even after resetting passwd and smbpasswd multiple times, any ideas? iptables set to allow…
Tyler,
Can you:
tail /var/log/messages
and see what errors you are getting. Are you using windows XP? or vista? how are you mapping the drive? via explorer or cmd prompt?
I think michael was right.. it won’t work if you move the configuration file. What will it read if there’s no smb.conf?
You should try it out Jon. Works fine. Thats why you do “vi smb.conf”
make sure the directory you are sharing exists /home/share and set with the proper security settings.
great instructions!
Forcing samba users to be root???
That is a BAD idea!
Robert, of course it is bad to force root but as i said in the post: NOTE: This set up is very “open” and should not be used on servers which are facing the world. This is for private network where you trust all the computers and its users.
This is for people to get samba setup and working and take it from there.
I have followed above smb.conf and i restarted the smb server after that i tried to access from win xp machine. I opened my network places it shows Wrkgrb i.e name of the work group we mentioned in the smb.conf file It shows error message like “wrkgrp is not accessible. you might not have permission to use this resource……………The device not connected.
I tried in the explorer typing \\ipaddress of linux box . it tells windows can not find.
As mentioned in the via cmd it says
C:\Documents and Settings\smbuser>net use z:\\10.0.0.100\share /user:smbuser
System error 67 has occurred.
The network name cannot be found.
I tried so mamy times but failed.
Please find out my mistake
I’ve following the above instructions, except the net use; to check if the share exists I used \\, to see if there are any shares however, from my WinXP maching I’m getting an error:
\\
Network path not found.
The same IP address is returning a ping reply. Any ideas?
Jon, just type net use
Nothing should follow after use
Thanks for correcting my typo. Still can’t access samba share though.