Cisco Router via SSH, failed to perform change password

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cisco Router via SSH, failed to perform change password

I am getting below error while performing the change password

[Connection]

; Prompts seen during SSH login

UsernamePrompt=([Uu]sername:|[Ll]ogin:)

PasswordPrompt=([Pp]assword:)

; Accept banners/MOTD (non-fatal)

IgnoreUntilShell=true

; Shell prompt (anchor for readiness). Adjust to match your prompt.

ShellPrompt=(cli%|#|>|\\$)\s*$

 

; Optional: extend timeout if device is chatty/slow

LoginTimeoutSeconds=60

 

[ChangePassword]

; Command to initiate password change (you said: cli% setpassword)

ChangeCommand=setpassword %USERNAME% %NEWPASSWORD%

 

; If device requires current password first, adjust:

; ChangeCommand=setpassword %USERNAME% %CURRENTPASSWORD% %NEWPASSWORD%

 

; Prompts encountered during change flow

ConfirmPrompt=(confirm:|retype new password:|re-enter:)

CurrentPwdPrompt=(current password:|old password:)

 

; Success conditions

SuccessRegex=(Password changed successfully|change completed|^.*cli%\s*$)

 

; Known failure messages (aggregate everything we�ve seen)

FailureRegex=(New passwords do not match\.?|Password is invalid\.?|Password must be less than or equal to 32 characters long\.?|Password must contain.*|Permission denied for the role|Authentication failed|Authorization failed)

 

; How long to wait for each step

ChangeTimeoutSeconds=60

 

[PostChange]

; Some plugins send 'copy running-config startup-config' or 'write memory' afterwards.

; If your role can�t save config, skip or make it conditional.

SaveConfigCommand=

; Example if allowed:

; SaveConfigCommand=write memory

 

; Consider the save successful when we hit the shell prompt again or see typical success text.

SaveSuccessRegex=(Building configuration|[OK]|^.*cli%\s*$)

SaveFailureRegex=(% Permission denied for the role|Error|Invalid input)

 

; Optional: delay before save (ms)

SaveDelay=500

 

14/01/2026 09:40:33.741 | Communication using Rebex was not successful. Fallback to Renci. Initial Exception: Expect.NET.SshPasswordAuthenticationException: Permission denied (password) ---> Rebex.Net.SshException: A supplied password or user name is incorrect. ---> Rebex.Net.SshException: A supplied password or user name is incorrect.

  at Rebex.Net.SshSession.ahjfn(String p0, String p1, xaxuc`1 p2, SshGssApiCredentials p3, Boolean p4)

  at Rebex.Net.Ssh.wwglj.gqrfr(String p0, String p1, xaxuc`1 p2, mxzkg p3)

  at Rebex.Net.Ssh.okymf(String p0, String p1, xaxuc`1 p2, mxzkg p3)

  --- End of inner exception stack trace ---

  at Rebex.Net.Ssh.okymf(String p0, String p1, xaxuc`1 p2, mxzkg p3)

  at Rebex.Net.Ssh.Login(String userName)

  at Expect.NET.Internal.Adapters.RebexAdapters.RebexSshClientAdapter.AuthenticateUsingPassword()

  --- End of inner exception stack trace ---

  at Expect.NET.Internal.Adapters.RebexAdapters.RebexSshClientAdapter.AuthenticateUsingPassword()

  at Expect.NET.Internal.Adapters.RebexAdapters.RebexSshClientAdapter.Authenticate()

  at Expect.NET.Internal.Adapters.RebexAdapters.RebexSshClientAdapter.Connect()

  at Expect.NET.SshSpawnable.Init()

14/01/2026 09:40:33.741 | Create RenciAdapter

14/01/2026 09:40:33.741 | Searching for ExpectConfiguration.ini file in: D:\Applications\PAM\CyberArk\Password Manager\bin

14/01/2026 09:40:34.038 | Getting stored fingerprint for 'ssh-rsa@22:ofpe01gamd1-admin.infra.lab.corp'.

14/01/2026 09:40:34.038 | 'ssh-rsa@22:ofpe01gamd1-admin.infra.lab.corp' fingerprint is a match.

14/01/2026 09:40:34.085 | Performing keyboard-interactive challenge-response authentication.

14/01/2026 09:40:34.085 | Remote SSH server has presented the following challenge 'Password: '.

14/01/2026 09:40:34.085 | Trying to match the following prompts:

14/01/2026 09:40:34.085 | 1.Password: 'Password:'

14/01/2026 09:40:34.085 | 'Password' is matched.

14/01/2026 09:40:34.085 | Sending: *****

14/01/2026 09:40:39.632 | Info -> MutexHandler :: ReleaseMutex -> Start

14/01/2026 09:40:39.632 | Info -> MutexHandler :: ReleaseMutex -> Release mutex 'HeavyCodeSection'

14/01/2026 09:40:39.632 | Info -> MutexHandler :: ReleaseMutex -> End

14/01/2026 09:40:39.632 | ERROR -> c :: d -> ah: Permission denied (password) ---> Expect.NET.SshAuthenticationException: Permission denied (password). ---> Renci.SshNet.Common.SshAuthenticationException: Permission denied (password).

  at Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo, ISession session)

  at Renci.SshNet.ConnectionInfo.Authenticate(ISession session, IServiceFactory serviceFactory)

  at Renci.SshNet.Session.Connect()

  at Renci.SshNet.BaseClient.CreateAndConnectSession()

  at Renci.SshNet.BaseClient.Connect()

  at Expect.NET.Internal.Adapters.RenciAdapters.RenciSshClientAdapter.Connect()

  --- End of inner exception stack trace ---

  at Expect.NET.Internal.Adapters.RenciAdapters.RenciSshClientAdapter.Connect()

  at Expect.NET.SshSpawnable.Init()

  at Expect.NET.APISpawnable.Init(IReadOnlyDictionary`2 settings)

  at Expect.NET.Expect.Spawn(ISpawnable spawnable, IReadOnlyDictionary`2 settings)

  at z.c()

  --- End of inner exception stack trace ---

  at z.c()

  at z.b()

  at y.CreateSession()

  at e.a()

  at bi.b(bv A_0, b4 A_1, t A_2)

  at bi.a(bv& A_0, b4 A_1)

  at bi.a(IList`1 A_0, bv A_1)

  at bi.i(IList`1 A_0, bv A_1)

  at e.a(IList`1 A_0)

  at e.a(bv A_0)

  at e.h(bv A_0, t A_1)

  at c.c(bv A_0)

  at c.a(bv A_0, dh A_1)

  at c.a(t A_0, bv A_1)

  at c.c(bv A_0)

  at c.d()

14/01/2026 09:40:39.632 | Info -> bl :: a -> Finish plugin execution

14/01/2026 09:40:39.632 | Info -> bl :: a -> Result: FAILURE

14/01/2026 09:40:39.632 | Info -> bl :: a -> Permission denied (password) RC: 2114

14/01/2026 09:40:39.632 | Info -> bh :: b -> |---------------------------------------|

14/01/2026 09:40:39.632 | Info -> bh :: b -> Plugin Execution END

14/01/2026 09:40:39.632 | Info -> bh :: b -> |---------------------------------------|

14/01/2026 09:40:39.632 | Info -> MutexHandler :: ReleaseMutex -> Start

14/01/2026 09:40:39.632 | Info -> MutexHandler :: ReleaseMutex -> End

 

4 REPLIES 4

L5 Sessionator

You had created CPM plugins manually or downloaded and used from Marketplace?

 

Is Verification working?

Only you getting error in Change part? If yes, then try checking if you can change the password manually using same creds in the target. If you can't change then it can be the issue. If not then some modification is needed.

L7 Applicator

Hi @Payaswini Soni​ 

 

Please try to log in to the Cisco router manually using Putty or an SSH client from the CPM server using the password stored in the Vault.

 

If manual login fails then please manually reset the password on the Cisco router and then update the same in the Vault.

 

Also please check with your Network team that CISCO router is configured to allow standard password authentication

 

And verify that Check if account is locked on the Cisco router due to too many failed CPM attempts.

 

 

Hope it helps !

 

I tried to log in manually using putty and it is successful. but when I try from CPM it fails. I downloaded the plugins from Marketplace.

When I checked the cisco process file found that it is performing Copy NVRAM like below.

#Copy NVRAM

ExitConfigMode=exit

CheckIfCommitSpecified

StartCommit=(startsync)tmp/pmterminal-cisco-$login_address

commit=copy running-config startup-config

EndCommit=(endsync)tmp/pmterminal-cisco-$login_address

CheckCommit=startup-config

 

And If I remove this step from the process, it changes the password in vault but on device it doesn't change.

 

Could you please suggest the changes that I can try.

If it is failing to get logged in from the CPM Server then it won't work. You have to fix that first. If you modify something in the process file then you have to work around prompts file too to match the loop. Just removing something won't fix. Prompts and Process are correlated.

  • 178 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!