I’m having a problem with fstab on Server 18.04. I’m trying to mount a number of Windows Server network shares. If I put the username and password into each line of fstab and do sudo mount -a
, it works fine. However, when I try to use a “credentials” file, it all goes pear-shaped.
So this:
//server/share /mount/point cifs ro,auto,user=user,password=password 0 0
…works fine.
However, if I try this:
//server/share /mount/point cifs ro,auto,credentials=/etc/.smbcredentials 0 0
…with .smbcredentials
containing the following:
user=username
password=password
domain=domain
…this does not work. sudo mount -a -v
outputs the following:
/ : ignored
/boot/efi : already mounted
none : ignored
domain=mydomain
,prefixpath=Projects/XYZ,pass=********.168.1.10,unc=\server\share,user=username
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
168.1.10
is the partial IP address of the server on which the shares that I want to mount are located. It appears that the password is being concatenated onto the IP of the server.
So, what am I doing wrong? Any help would be much appreciated.
My working credentials file is located in my ~ folder and looks like this
Its permissions are
-rw-------
and it is owned by my user.The corresponding fstab line is
I don't use "domain" but that doesn't mean that you don't need it.
Had same issue, check for errors with:
-- > kernel: [ 7917.935203] CIFS VFS: No username specified
Fixed it for me..
I was having trouble mounting my QNAP NAS Samba share on Ubuntu 18.04 with a credentials file. Here's what worked for me after trying on and off for months.
username
so I created a user on QNAP calledusername
and generated a random password with LastPass.nano ~/.samba_credentials
Here's how mine looks:
The domain option might be optional but the default Windows 10 workgroup is
WORKGROUP
so this should work as long as you didn't change it. And if you did change it you probably know what a workgroup is and what value you changed it to.mkdir /media/username/storage
/etc/fstab
file to auto-mount the QNAP Samba share via CIFS://nas1da09d.local/files /media/username/storage cifs credentials=/home/username/.samba_credentials,uid=username,noperm,rw 0 0
When mounting several smb drives with same credentials you have to create one credential file per mount. In other words, you can not use one credential file for several mounts.
Create a new file for each mount
add your credentials to each file
then chmod the files for protection
then use each file as credantials for each mount sudo nano /etc/fstab
then mount
this will probably solve your issue.