Sharing 2nd Hard Disk Drive in Ubuntu Server 12.4

15,141

I think that this guide will be helpful for you:

https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way!

The main steps from the guide:

  1. Set a password for your user in Samba

    sudo smbpasswd -a <user_name>
    
  2. Create a directory to be shared

    mkdir /home/<user_name>/<folder_name>
    
  3. Make a backup to be safe:

    sudo cp /etc/samba/smb.conf ~
    
  4. 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!
    
  5. When done, restart the samba:

    sudo restart smbd
    
  6. Once Samba has restarted, to check syntax errors, run:

    testparm
    
  7. 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".

Share:
15,141

Related videos on Youtube

Neil
Author by

Neil

Updated on September 18, 2022

Comments

  • Neil
    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
    sboda over 10 years
    Sorry 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
    Neil over 10 years
    sboda, 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
    sboda over 10 years
    You're welcome! You should add write list = user_name after browseable = yes. (I think if you add just write list = * then anyone will have acces to write it!) Please accept my answer, if this will work!