sudo apt-get install samba smbfsEdit smb.conf
Open the samba configuration file in your favourite editor, change security to user and add a username map.
sudo vi /etc/samba/smb.confCreate a samba user
# "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/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user username map = /etc/samba/smbusers
sudo smbpasswd -a fahdAdd the new user to the smbusers file
The format is "unix username" = "samba username".
sudo vi /etc/samba/smbusersShare home directory
fahd = fahd
Make the following changes to smb.conf in order to share your home directory over samba and make it writable.
sudo vi /etc/samba/smb.confConnecting to the samba
#======================= Share Definitions ======================= # Un-comment the following (and tweak the other settings below to suit) # to enable the default home directory shares. This will share each # user's home directory as \\server\username [homes] comment = Home Directories browseable = no # By default, the home directories are exported read-only. Change the # next parameter to 'no' if you want to be able to write to them. read only = no # By default, \\server\username shares can be connected to by anyone # with access to the samba server. Un-comment the following parameter # to make sure that only "username" can connect to \\server\username # This might need tweaking when using external authentication schemes valid users = %S
Now you should be able to map a drive on windows using the following share format: \\ubuntumachine\username. The first time you will be prompted for a username and password. Restarting samba
sudo /etc/init.d/samba restart