You are not logged in.

#1 2025-03-05 13:41:06

philipn
Member
Registered: 2012-12-17
Posts: 12

cifs mount failing with Bad value for 'password2'

I have a long standing SMB share restricted to guest access only from the local network. The share is still running and is accessible from Windows and Android but has recently stopped working from my Arch system.

/etc/fstab:

# Public on guestshare
//guestshare/public    /mnt/public    cifs    guest,user,noauto    0 0

Here it is failing

$ mount --verbose /mnt/public
Host "guestshare" resolved to the following IP addresses: 192.168.1.9
mount.cifs kernel mount options: ip=192.168.1.9,unc=\\guestshare\public,noauto,uid=501,gid=501,user=,pass=********,password2=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

dmesg reports:

cifs: Bad value for 'password2'

The dmesg line is instant and nothing appears on the server logs, suggesting no connection was attempted and it is a local problem. I have not knowingly changed anything except for regular updates to the Arch system which reports:

$ uname -a
Linux capella 6.13.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 27 Feb 2025 18:09:44 +0000 x86_64 GNU/Linux

I am not aware that either password or password2 are given values anywhere. Neither PASSWD nor PASSWD2 are set in my environment.

Last edited by philipn (2025-03-05 14:44:49)

Offline

#2 2025-03-05 15:40:30

seth
Member
Registered: 2012-09-03
Posts: 63,045

Re: cifs mount failing with Bad value for 'password2'

//guestshare/public    /mnt/public    cifs    guest,user,noauto    0 0

mount.cifs kernel mount options: ip=192.168.1.9,unc=\\guestshare\public,noauto,uid=501,gid=501,_____user=_____,pass=********,password2=********

https://man.archlinux.org/man/mount.cif … g_user=arg
Remove that key, did you mean "users"?

Otherwise

I am not aware that either password or password2 are given values anywhere.

And what values are used? (Or is the obfuscation not yours?)

Last edited by seth (2025-03-05 15:40:55)

Offline

#3 2025-03-05 15:53:45

philipn
Member
Registered: 2012-12-17
Posts: 12

Re: cifs mount failing with Bad value for 'password2'

Thanks seth,
The "user" option is intended. fstab manual shows:

user
           allow a user to mount

I am mounting as an ordinary user. however, I have tried sudo and the result is just the same.

And what values are used? (Or is the obfuscation not yours?)

The obfuscation is not mine - the asterisks are exactly as in the message.

Last edited by philipn (2025-03-05 15:54:20)

Offline

#4 2025-03-05 15:58:39

seth
Member
Registered: 2012-09-03
Posts: 63,045

Re: cifs mount failing with Bad value for 'password2'

Yes, but it would seem to collide w/ the cifs options, does the error remain when removing it?

Offline

#5 2025-03-05 18:18:48

philipn
Member
Registered: 2012-12-17
Posts: 12

Re: cifs mount failing with Bad value for 'password2'

seth wrote:

Yes, but it would seem to collide w/ the cifs options, does the error remain when removing it?

I changed user to users in /etc/fstab and it makes no difference at all. Removing the "user/users" option entirely gives "permission denied" as expected for user mount but fails in exactly the same way for sudo mount.

Since the "guest" option is specified, the "user=<blank>" would seem correct.

Offline

#6 2025-03-05 18:22:48

philipn
Member
Registered: 2012-12-17
Posts: 12

Re: cifs mount failing with Bad value for 'password2'

The options user=,pass=********,password2=******** that mount.cifs is passing to the kernel appear to be defaults generated by mount.cifs since they are not specified in /etc/fstab, in the environment, or on the command line.

Offline

#7 2025-03-05 19:36:37

seth
Member
Registered: 2012-09-03
Posts: 63,045

Re: cifs mount failing with Bad value for 'password2'

'key, let's see what happens if you take control over the mount (comment the fstab entry to get that out of the euqation, and)

sudo mount -t cifs //guestshare/public  /mnt/public -o guest,user=,pass="",password2=""

Offline

#8 2025-03-05 23:29:41

philipn
Member
Registered: 2012-12-17
Posts: 12

Re: cifs mount failing with Bad value for 'password2'

seth wrote:

'key, let's see what happens if you take control over the mount (comment the fstab entry to get that out of the euqation, and)

sudo mount -t cifs //guestshare/public  /mnt/public -o guest,user=,pass="",password2=""

As you suggest, I commented out the line in fstab (and did 'systemctl daemon-reload). I now get this

$ sudo mount -t cifs --verbose //guestshare/public  /mnt/public -o guest,user=,pass="",password2=""
password specified twice, ignoring second
password2 specified twice, ignoring second
Host "guestshare" resolved to the following IP addresses: 192.168.1.9
mount.cifs kernel mount options: ip=192.168.1.9,unc=\\guestshare\public,user=,pass=********,password2=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

It looks like the guest option is expanding to generate values for password and password2. If I remove pass="",password2="" I get:

$ sudo mount -t cifs --verbose //guestshare/public  /mnt/public -o guest,user=
Host "guestshare" resolved to the following IP addresses: 192.168.1.9
mount.cifs kernel mount options: ip=192.168.1.9,unc=\\guestshare\public,user=,pass=********,password2=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

If I remove the guest option instead I get a sustitution of user=root:

$ sudo mount -t cifs --verbose //guestshare/public  /mnt/public -o user=,pass="",password2=""
Host "guestshare" resolved to the following IP addresses: 192.168.1.9
mount.cifs kernel mount options: ip=192.168.1.9,unc=\\guestshare\public,user=root,pass=********,password2=********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

In all cases dmesg just shows:

cifs: Bad value for 'password2'

Offline

#9 2025-03-06 10:44:33

Apion
Member
Registered: 2020-06-23
Posts: 3

Re: cifs mount failing with Bad value for 'password2'

Downgrading from cifs-utils-7.2-1 to cifs-utils-7.1-1 fixed the problem for me

Edit: You can also just append sec=none to the mounting options, that makes it so that the password options don't get appended to the mount string

Last edited by Apion (2025-03-06 11:05:26)

Offline

#10 2025-03-06 12:47:18

seth
Member
Registered: 2012-09-03
Posts: 63,045

Re: cifs mount failing with Bad value for 'password2'

just append sec=none to the mounting options

Is there an upstream bug reg. this?
I mean, mount.cifs hallucinating password parameters?

Offline

#11 2025-03-06 14:38:16

philipn
Member
Registered: 2012-12-17
Posts: 12

Re: cifs mount failing with Bad value for 'password2'

Apion wrote:

Edit: You can also just append sec=none to the mounting options, that makes it so that the password options don't get appended to the mount string

Thanks, that has fixed the issue.

It isn't at all clear from the manual what the difference between 'guest' and 'sec=none' is although they are described in very different terms.

I agree with seth that there is an upstream issue here.

Offline

Board footer

Powered by FluxBB