To install, first open a terminal window and enter the following command:
sudo apt-get install samba smbfsWe’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.confFind this section in the file:
####### Authentication #######Uncomment the security line, and add another line to make it look like this:
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user
security = userThis will set Samba to use the smbusers file for looking up the user list.
username map = /etc/samba/smbusers
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>Next, we’ll add that username to the smbusers file.
sudo gedit /etc/samba/smbusersAdd in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.
<username> = “<username>”Now you can create samba shares and give access to the users that you listed here.