How to configure Linux File Server using Samba
Samba is the most common uses of a Linux and Ubuntu machine to share files across the network. Samba makes easy to share files with Windows-based computers. In this article we’ll show you how to set up a Samba server, and how to access those shares from client computers,
Install Samba by running command
For Ubuntu
$ sudo apt-get install samba
For Linux
$ yum install samba
Samba stores its own set of user accounts, separate from the main accounts, in the /etc/samba/smbpasswd file. so you need to create a separate Samba password for every user you want.
You create this password use the smbpasswd command. For example, to create a command for a user named Rahul:
$ sudo useradd rahul
$ sudo smbpasswd -a rahul
Once user password is created, the next step is to configure the file
$sudo vim /etc/samba/smb.conf
The smb.conf file is long and rather complex, but for the purposes of this demonstration, you can ignore most of it. Key down to the very end of the file and insert this text:
[samba-share]
comment = For public
path = /home/rahul
browseable = yes
writable = yes
guest ok = no
valid users = rahul
The settings specified above will share the samba-share folder.Once you have input the changes, save smb.conf, and restart Samba with this command:
$sudo /etc/init.d/smb start
Once Samba has started, use this command to check your smb.conf for any syntax errors:
$sudo testparm
If you pass the testparm command, Samba should be working. Try accessing the share from another client on your LAN.
Now Access in Windows
go to run and type //IP of samba server
like //10.10.10.142
Install Samba by running command
For Ubuntu
$ sudo apt-get install samba
For Linux
$ yum install samba
Samba stores its own set of user accounts, separate from the main accounts, in the /etc/samba/smbpasswd file. so you need to create a separate Samba password for every user you want.
You create this password use the smbpasswd command. For example, to create a command for a user named Rahul:
$ sudo useradd rahul
$ sudo smbpasswd -a rahul
Once user password is created, the next step is to configure the file
$sudo vim /etc/samba/smb.conf
The smb.conf file is long and rather complex, but for the purposes of this demonstration, you can ignore most of it. Key down to the very end of the file and insert this text:
[samba-share]
comment = For public
path = /home/rahul
browseable = yes
writable = yes
guest ok = no
valid users = rahul
The settings specified above will share the samba-share folder.Once you have input the changes, save smb.conf, and restart Samba with this command:
$sudo /etc/init.d/smb start
Once Samba has started, use this command to check your smb.conf for any syntax errors:
$sudo testparm
If you pass the testparm command, Samba should be working. Try accessing the share from another client on your LAN.
Now Access in Windows
go to run and type //IP of samba server
like //10.10.10.142
How to configure Linux File Server using Samba
Reviewed by TecGeeks News
on
April 06, 2016
Rating:
No comments: