Announcement

Collapse
No announcement yet.

CIFS Mount Synology Share

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CIFS Mount Synology Share

    Hi all,

    I try to mount via CIFS Synology share, I am able to do so manually via user and password, but when I try to use credentials file it wont work.
    I try many versions of credential file

    nameuser=<username>
    password=<password>

    empty line at bottom or not, even with domain but nothing is working

    I really confused because this works:
    Code:
    sudo mount -t cifs //server/share /mnt/.../.. -o username=username,password=password,rw,dir_mode=0777,file_mode=0777,vers=3.0
    ​
    but same with creds is not working
    Code:
    sudo mount -t cifs //server/share /mnt/.../.. -o credentials=/path/to/creds,rw,dir_mode=0777,file_mode=0777,vers=3.0
    ​
    System:
    Distributor ID:Ubuntu
    Description:Ubuntu 25.10
    Release:25.10
    Codename:questing
    Kernel:6.17.0-14-generic


    Thank you

    #2
    AI Overview

    To mount a CIFS/SMB Synology share using a credentials file in Linux, create a hidden file (e.g.,
    /root/.smbcredentials) containing your NAS username and password, secure it with chmod 600, and reference it in /etc/fstab with the credentials= option. This avoids storing passwords in plain text within fstab.

    Step-by-Step Configuration

    1. Create the Credentials File:
    Create a new file, for example, /root/.smbcredentials or /home/youruser/.smbcredentials.

    sudo nano /root/.smbcredentials

    2. Add Credentials:
    Add the following lines to the file, replacing with your Synology NAS details:

    username=your_synology_user
    password=your_synology_password
    domain=WORKGROUP # Optional, default is WORKGROUP

    3. Secure the File:
    Restrict permissions so only root can read it:

    sudo chmod 600 /root/.smbcredentials

    4. Configure /etc/fstab:
    Add your mount entry to /etc/fstab to use the file.

    //192.168.x.x/sharename /mnt/synology cifs credentials=/root/.smbcredentials,uid=1000,gid=1000,iocharset=utf8,v ers=3.0,nofail 0 0

    Note: uid and gid ensure your local user owns the mounted files.
    Note: vers=3.0 is recommended for modern Synology NAS systems.

    5. Mount the Share:
    Test the configuration:

    sudo mount -a

    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment

    Users Viewing This Topic

    Collapse

    There are 0 users viewing this topic.

    Working...
    X