I'm on Kubuntu 24.04.1 and I've managed to succesfully mount a smb share with cifs by adding it in /etc/fstab
, with this line:
//192.168.10.122/Test /mnt/Test cifs user,noauto,user=test,password=test 0 0
The problem is that the password is in plain text which is not secure. So I've followed a new guide, by creating a credential file (.smb_cred
) with chmod 600
(read and write) and put this line instead:
//192.168.10.122/Test /mnt/Test cifs uid=1000,credentials=/home/test/.smb_cred,iocharset=utf8 0 0
The problem is that it doesn't work. I see the mounted file but it's empty.
It's not automounting since you specified
noauto
in the declare statement. You have given a non-root user the ability to mount it however with the precedinguser
option.That line is attempting to do the opposite. It's attempting to automatically mount the share at boot time.
After a reboot if the share doesn't mount open a terminal and run:
If the share is now mounted you can either:
Incorporate the user,noauto method you used in the first declaration:
Or, use a systemd automounter: x-systemd.automount:
Note: If you have an encrypted home directory the credentials file needs to be someplace else like
/etc/samba/cred-files/.smb_cred