Mount CIFS share gives "mount error 127 = Key has expired"

I'm currently replicating the setup of a CentOS box an am running into a strange error while trying to mount a samba share that resides on a NAS. The error I'm getting is:

mount error 127 = Key has expired

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

The settings are identical to the old machine, the password is definitely correct as well. I have googled the issue of course, and looked at every single page that references this issue (not that many) and have still not found an answer.

The older CentOS box is using version 3.0.28-0.el4.9 of Samba and the one I'm trying to setup now is 3.0.33-3.7.el5_3.1. I don't know if this has anything to do with it but it's certainly one of the only differences between the 2 setups.

When I try the mount command this appears in the syslog:

Sep  8 10:51:54 helvetica2 kernel: Status code returned 0xc0000072 NT_STATUS_ACCOUNT_DISABLED

Sep  8 10:51:54 helvetica2 kernel:  CIFS VFS: Send error in SessSetup = -127

Sep  8 10:51:54 helvetica2 kernel:  CIFS VFS: cifs_mount failed w/return code = -127

The account is very much not disabled as it works on the old box using the same credentials.

Has anyone else seen this problem?


Solution 1:

I had the similar problem. The reason for it is that your password may have expired or need to change it You can solve it as follows:

  1. Login into the Windows Machine or Remote Desktop it
  2. After entering your current correct credentials, you'll be prompted to change the password
  3. Provide a new password
  4. After the password is successfully changed, try mounting again (and it should work)

Solution 2:

Maybe you solved this....

Basically yoiu go to the computer you try to connect to, login and reissue the password for the account you use... you can re-use the same password if you want... you are then good for a certain number of days as per your system defaults if you didn't change anyting 8)

Solution 3:

The same thing just happened to me. Check your login account and change the Password expires to Never

See below for my net user output.

C:\Users\usr>net user remote
User name                    remote
Full Name
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            9/15/2013 1:33:43 PM
Password expires             10/27/2013 1:33:43 PM <<<<<<< # password expired
Password changeable          9/15/2013 1:33:43 PM
Password required            Yes
User may change password     Yes

To set the account's Password expires field to Never, run the following command.

WMIC USERACCOUNT WHERE "Name='username" SET PasswordExpires=FALSE

So, for example, for my account, I would run:

WMIC USERACCOUNT WHERE "Name='remote" SET PasswordExpires=FALSE

Command prompt output:

wmic:root\cli>useraccount where "name='remote'" set PasswordExpires=FALSE
Update property(s) of '\\READINGRAINBOW\ROOT\CIMV2:Win32_UserAccount.Domain="ReadingRainbow",Name="remote"' (Y/N/?)? y
Property(s) update successful.
wmic:root\cli>

When you check the account again it should be changed to Never

C:\Users\usr>net user remote
User name                    remote
Full Name
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            10/28/2013 8:33:29 PM
Password expires             Never                  <<<<<<< # Changed to Never
Password changeable          10/28/2013 8:33:29 PM

Solution 4:

I've got same error with ubuntu 11.04/windows 7

After I tried to log in (on windows machine) as user, which credentials used in samba mount options,

windows said account password expired and prompted for new password.

I changed account password both at windows machine and in .credentials,

now my share mounts.

Solution 5:

Are the date/time on your NAS and Linux machine synced?