Install Samba Server on Ubuntu
If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.
To install, first open a terminal window and enter the following command:
sudo apt-get install samba smbfs
We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:
sudo gedit /etc/samba/smb.conf
Find this section in the file:
####### Authentication #######
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# in the samba-doc package for details.
; security = user
Uncomment the security line, and add another line to make it look like this:
security = user
username map = /etc/samba/smbusers
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
This will set Samba to use the smbusers file for looking up the user list.
Create a Samba User
There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.
sudo smbpasswd -a <username>