Sharing 2nd Hard Disk Drive in Ubuntu Server 12.4
I think that this guide will be helpful for you:
The main steps from the guide:
-
Set a password for your user in Samba
sudo smbpasswd -a <user_name>
-
Create a directory to be shared
mkdir /home/<user_name>/<folder_name>
-
Make a backup to be safe:
sudo cp /etc/samba/smb.conf ~
-
Edit the conf file (you can use any editing program, I prefer gedit)
sudo gedit /etc/samba/smb.conf
add the following lines to the end of the file:
[<folder_name>] path = /home/<user_name>/<folder_name> available = yes valid users = <user_name> read only = no browseable = yes public = yes writable = yes ##Note that before and after the equal sign should be a SPACE!
-
When done, restart the samba:
sudo restart smbd
-
Once Samba has restarted, to check syntax errors, run:
testparm
-
To access the shared directory from windows run:
\\<HOST_IP_OR_NAME>\<folder_name>\
The folder name will be the value that you used in "" in "/etc/samba/smb.conf".
Related videos on Youtube
Neil
Updated on September 18, 2022Comments
-
Neil almost 2 years
Greetings to all the techies and Gurus!
I have Ubuntu Server 12.4 LTS with Samba Server Installed. I have a 2nd 2TB HDD. I want to Create a Folder in the 2nd HDD and share it with windows PC's.... How do I do it? Appreciate all your help peepz.. Chers
-
sboda over 10 yearsSorry for the late answer, yes, that's also possible, assuming that the partition is mounted... You will have to change path = /media/sdb5/custom if the partition is mounted in /media/sdb5, or you can right click on the mounted drive and you can find under properties the file path...
-
Neil over 10 yearssboda, thank you for that I manage to share the folder, I can navigate in the folder from a windows user... but the non of the windows users are unable to create/modify/save any file under the folder. I have no restricted permission set to the folder folder is set to 777... any idea where i am going wrong?
-
sboda over 10 yearsYou're welcome! You should add
write list = user_name
afterbrowseable = yes
. (I think if you add justwrite list = *
then anyone will have acces to write it!) Please accept my answer, if this will work!