26

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?

chicks
  • 3,639
  • 10
  • 26
  • 36
djk
  • 682
  • 2
  • 9
  • 15
  • 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 '09 at 04:11

9 Answers9

16

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)
Mahendra Liya
  • 339
  • 1
  • 5
  • 13
7

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)

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.

jonny
  • 357
  • 1
  • 3
  • 14
4

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
naisanza
  • 170
  • 4
  • 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 '19 at 20:48
2

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

James
  • 7,553
  • 2
  • 24
  • 33
1

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!

Dr I
  • 943
  • 16
  • 33
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

adrianTNT
  • 1,007
  • 5
  • 21
  • 41
0

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?

EDIT:

Does this post help?

EDIT2:

Does it works if you use smbfs instead of cifs ?

drAlberT
  • 10,871
  • 7
  • 38
  • 52
0

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

to

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