Mount CIFS: credentials option of mount is not working

0

I am currently trying to mount a cifs file server. I can do if I give my password manually:

root# mount -v -t cifs //server.mydomain/homes$/user.NAME /mnt -o username=user.NAME@mydomain
Password for user.NAME@mydomain@//server.mydomain/homes$/user.NAME:  ************
mount.cifs kernel mount options: ip=10.9.99.99,unc=\\server.mydomain\homes$,user=user.NAME@mydomain,prefixpath=user.NAME,pass=********

But if I replace the username option with credentials option, I can not mount the cifs:

root# mount -v -t cifs //server.mydomain/homes$/user.NAME /mnt -o credentials=/root/smbcredential
,prefixpath=user.NANE,pass=********.24.29,unc=\\server.mydomain\homes$,user=user.NAME
mount error(13): Permission denied

/root/smbcredential is a text file consisting of two lines

username=user.NAME@mydomain
password=1234#abc

and its permission is 600.

Question: Why is the credentials option not working?

Notes:

  • username, password, domain and ip are obviously replaced with dummy strings.
  • But password contains a character #. I also tried to replace it with %23, but it has no effect.
  • I also tried to add the third line. i.e. domain, but it has no effect, neither.

    username=user.NAME
    password=1234#abc
    domain=mydomain
    
  • dmesg says Status code returned 0xc000006d STATUS_LOGON_FAILURE, so I could give the wrong credential.
  • I am working on a Linux container based on python:3.7-slim-buster. Because the first command works, Doker does not cause this problem.
linux
mount
cifs
asked on Stack Overflow May 18, 2020 by H. Shindoh • edited May 18, 2020 by H. Shindoh

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0