Skip to content

Instantly share code, notes, and snippets.

@giordanocardillo
Last active October 10, 2024 04:26
Show Gist options
  • Save giordanocardillo/05a89065ff0843c6da116993e8f16913 to your computer and use it in GitHub Desktop.
Save giordanocardillo/05a89065ff0843c6da116993e8f16913 to your computer and use it in GitHub Desktop.
Mounting Samba share on Ubuntu

Mounting Samba share on Ubuntu

  1. Install package cifs-utils

     sudo apt-get install cifs-utils
    
  2. Create folder to mount the share into

     sudo mkdir /media/Share
    
  3. Create file with user credentials in your home directory

     touch ~/.smbcredentials
    

    3.1. Edit the file

     username=smb_username
     password=smb_password
    
  4. Edit /etc/fstab

     sudo nano /etc/fstab
    

    4.1. Add the following line (edit where necessary)

     //192.168.1.1/share /media/Share cifs credentials=/home/user/.smbcredentials,users,rw,iocharset=utf8,sec=ntlm 0 0
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment