I cannot figure out how to mount SMB shares from the Linux command line. I am able to get to them using Nautilus on Linux and Windows machines. So, I’m assuming that my permissions are correct. I’ve tried specifying anywhere from minimal options to tons of options, but I always get mount error(13): Permission denied. Permissions are backed by a domain controller. What am I missing?
Here are some things that I’ve tried.
mount -o username=user,domain=domain.lan,iocharset=utf8,sec=ntlmssp -t cifs //192.168.10.37/SMB /mnt --verbose
mount -o vers=3,uid=22104,gid=20513,username=user,password=password,domain=domain.lan,iocharset=utf8 -t cifs //192.168.10.37/XOABackup /mnt --verbose
Probably not the cause but I prefer to mount to some directory I created beforehand /mnt/somedir.
I don’t specify domain in my credentials file for /etc/fstab
These are your UID and GID? Did you confirm with id -u and id -g?
From my perspective
mount -t cifs -o uid=22104,gid=20513,username=user,password=password,iocharset=utf8 //192.168.10.37/XOABackup /mnt/XOABackup
The primary goal in trying to get this to work is as a backup target for my xcp-ng hypervisor. I was getting errors when trying to set this up in XOA. So I switched to poking at it in the command line on my desktop.
sudo mount -o vers=3,uid=22104,gid=20513,username=xoabackup,password=password,domain=domain.lan,iocharset=utf8 -t cifs //192.168.10.37/XOABackup /mnt --verbose
mount.cifs kernel mount options: ip=192.168.10.37,unc=\\192.168.10.37\XOABackup,vers=3,iocharset=utf8,uid=22104,gid=20513,user=xoabackup,domain=domain.lan,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
dmesg doesn’t seem to provide anything useful.
[91094.037222] CIFS: Attempting to mount //192.168.10.37/XOABackup
[91094.066760] CIFS: Status code returned 0xc000006d STATUS_LOGON_FAILURE
[91094.066785] CIFS: VFS: \\192.168.10.37 Send error in SessSetup = -13
[91094.066826] CIFS: VFS: cifs_mount failed w/return code = -13
I did an id for the user on TrueNAS to get the uid and gid.
@Davvo I run TN Core on dedicated bare metal. I’ve tried mounting the share from a VM and from my desktop machine with the same results.
Hi @mouseskowitz any update on this?
I want to mount the SMB into an Ubuntu VM and I also get the permission problem… From my Windows computer works, so the user and permisions should be fine…
The command I’m running is sudo mount -t cifs //<ip>/raid /mnt/RAID -o username=<user>,file_mode=0777,dir_mode=0777
@chuck32 thanks for the reply. Neither of both methods you provided work…
Also, the second method should be mount -t cifs //TRUENASIP/SMBSHARENAME /mnt/remote/SMBSHARENAME -o username=USERNAME,password=PASSWORD,iocharset=utf8,uid=1000,gid=1000
I was able to mount it, by launching a second SMB app (so it’s not the best solution…)
If you want to do it:
Create the app
On TrueNAS, add a “custom application”. Set the image dperson/samba, and add all this commands: /sbin/tini, --, /usr/bin/samba.sh, -p, -u, <user>;<password>, -s, <dir>;/mnt/<dir>;no;no;no;<user>. You’ll have to set also the environment variables USERID=<user_id> and GROUPID=<group_id>. Add a port forwarding of the TCP port 445 to 9300, and then all the storage you want to share.
Setup the linux
Install the dependencies: sudo apt-get install cifs-utils
Create a file /etc/.truenas_creds with the following: