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?

  • 1
    Are you using Kerberos on the old server by any chance to get an authenticated ticket, but not on the new system?
    – pjd
    Dec 21, 2009 at 4:11

9 Answers 9


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)

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)


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.

  • oops, it seems like I missed Laurent answer
    – jonny
    May 27, 2011 at 18:26

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
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.

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

C:\Users\usr>net user remote
User name                    remote
Full Name
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
  • Worked, thanks! Note that you need to start the Windows Management Instrumentation service for the WMIC commands to work. I turned it off in the past and never ran into it until now, took me a while to figure that something basic like "change whether your user account's password expires" needs a dedicated service to run...
    – Luc
    May 13, 2019 at 20:48

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

  • Yep, both using the same NTP server. Exactly the same time on both.
    – djk
    Sep 25, 2009 at 10:30

the only three factor that I personnaly faced using CIFS on linux where (as said upper):

1°/-Kerberos ticket refresh error (umount your point, stop the kernel module, purge every cache).

2°/-Password issues due to some weird ciphering problems (quite impossible to solve quickly without deeper inspection of logs and network capture on both side).

3°/-Time setup on the linux side difer from the windows one for more than a second.

I do not said those upper points are the solution, but, it can help ;-)

See ya!


Maybe I'm pedant, but have you tried from another machine after you have got the error?

Are you really sure the account is not just expired now?


Does this post help?


Does it works if you use smbfs instead of cifs ?

  • Yep, the old machine works fine. It can mount the share but the new one can't. The account is set to never expire in AD as well.
    – djk
    Sep 8, 2009 at 10:35
  • Thanks for the link in your edit but sadly trying what's in there doesn't make any difference.
    – djk
    Sep 9, 2009 at 8:57
  • Nope, smbfs isn't valid in CentOS 5.3. Have to use CIFS.
    – djk
    Sep 9, 2009 at 14:17
  • sorry can't help then
    – drAlberT
    Sep 9, 2009 at 15:05

Got a similar problem just now, and solved by changing

//host/path  /mnt/path  cifs  username=username1,password=password1,iocharset=utf8,sec=ntlm  0  0


//host/path  /mnt/path  cifs  username=domain1\username1,password=password1,iocharset=utf8,sec=ntlm  0  0

I got this error today when I tried to remove a directory, it was because ...

Even thou df -h would not show this folder as a mounted path, it was actually mounted but remote server was disconnected (or refusing connection).

I seen the path defined in /etc/fstab and I was able to remove the folder after unmounting the path with

umount /my_path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.