How to Setup Samba (file Server)
by thermoelectric in Circuits > Linux
46514 Views, 31 Favorites, 0 Comments
How to Setup Samba (file Server)
This Instructable will guide you through configuring Samba
This Instructable is based on Linux Ubuntu 9.04. The instructions on setting it up with newer versions will be pretty much identical
I will focus on just setting up a file server in this Instructable, although Samba can be expanded to run as an Active Domain Controller for Windows and a lot more
This Instructable is based on Linux Ubuntu 9.04. The instructions on setting it up with newer versions will be pretty much identical
I will focus on just setting up a file server in this Instructable, although Samba can be expanded to run as an Active Domain Controller for Windows and a lot more
Background on Samba
Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients.
Samba-3 by Example explains further, saying:
Samba is software that can be run on a platform other than Microsoft Windows, for example, UNIX, Linux, IBM System 390, OpenVMS, and other operating systems. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server.
From The Official Samba HOWTO:
The goal behind the project is one of removing barriers to interoperability.
Samba is a software package that gives network administrators flexibility and freedom in terms of setup, configuration, and choice of systems and equipment. Because of all that it offers, Samba has grown in popularity, and continues to do so, every year since its release in 1992.
For more details on Samba or SMB, see:
Intro to Samba
SMB/CIFS Links
Samba-3 by Example explains further, saying:
Samba is software that can be run on a platform other than Microsoft Windows, for example, UNIX, Linux, IBM System 390, OpenVMS, and other operating systems. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server.
From The Official Samba HOWTO:
The goal behind the project is one of removing barriers to interoperability.
Samba is a software package that gives network administrators flexibility and freedom in terms of setup, configuration, and choice of systems and equipment. Because of all that it offers, Samba has grown in popularity, and continues to do so, every year since its release in 1992.
For more details on Samba or SMB, see:
Intro to Samba
SMB/CIFS Links
- From here
Let's Start!
Configure Samba
Type sudo gedit /etc/samba/smb.conf in terminal to open and edit Samba's configuration file.
Add netbios name = server and replace server with whatever you want the servers name to be
Change %S next to valid users to the users you want to be able to access this drive (we will add users to the system in the next step)
Un-comment the options there ([homes], comment, browseable, read only and valid users) by removing the ; in front of them
If you want to add more drives just repeat those options e.g.
[public]
comment = Data
path = /export
force user = thermoelectric
force group = users
read only = No
Path is where that shared drive is located.
- Scroll down to Global Settings in the .conf file
Add netbios name = server and replace server with whatever you want the servers name to be
- Scroll down to Share Definitions in the .conf file
Change %S next to valid users to the users you want to be able to access this drive (we will add users to the system in the next step)
Un-comment the options there ([homes], comment, browseable, read only and valid users) by removing the ; in front of them
If you want to add more drives just repeat those options e.g.
[public]
comment = Data
path = /export
force user = thermoelectric
force group = users
read only = No
Path is where that shared drive is located.
Adding Users to Samba
Add users to Ubuntu by typing this into terminal e.g
sudo useradd -c "Thermoelectric Rules" -m -g users -p password Thermoelectric
You replace password with that users password. You replace Thermoelectric Rules with your real name. You replace Thermoelectric with your user name.
Repeat that until you have made a account for all of your users
Then add the users to Samba by typing this into terminal e.g
sudo smbpasswd -a Thermoelectric
Replace Thermoelectric with your user name
Repeat until you have added all your users to Samba
sudo useradd -c "Thermoelectric Rules" -m -g users -p password Thermoelectric
You replace password with that users password. You replace Thermoelectric Rules with your real name. You replace Thermoelectric with your user name.
Repeat that until you have made a account for all of your users
Then add the users to Samba by typing this into terminal e.g
sudo smbpasswd -a Thermoelectric
Replace Thermoelectric with your user name
Repeat until you have added all your users to Samba
Start and Test Samba
Start Samba by executing this in terminal
sudo nmbd; smbd;
Configure the /export directory:
sudo mkdir /export
sudo chown Thermoelectric.users /export
sudo chmod u=rwx,g=rwx,o-rwx /export
Check that Samba is running correctly:
sudo smbclient -L localhost -U%
Connect to SERVER (netbios name) as Thermoelectric (your user name):
sudo smbclient //SERVER/Thermoelectric -UThermoelectric%password
sudo nmbd; smbd;
Configure the /export directory:
sudo mkdir /export
sudo chown Thermoelectric.users /export
sudo chmod u=rwx,g=rwx,o-rwx /export
Check that Samba is running correctly:
sudo smbclient -L localhost -U%
Connect to SERVER (netbios name) as Thermoelectric (your user name):
sudo smbclient //SERVER/Thermoelectric -UThermoelectric%password
Finish!
I hope you enjoyed this Instructable.
If you experience any errors while installing and using Samba, I will be glad to help.
Have you succeeded installing and using Samba? If so comment!
Is there anything you think I need to add to this Instructable? Comment and tell me!
Thanks. Please comment and rate
If you experience any errors while installing and using Samba, I will be glad to help.
Have you succeeded installing and using Samba? If so comment!
Is there anything you think I need to add to this Instructable? Comment and tell me!
Thanks. Please comment and rate