cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
12180
Views
0
Helpful
1
Replies

Scripting using powershell

TGF_Cisco
Level 1
Level 1

hello

I am trying to login to network devices which are enabled for SSH only. With my script, it doesnt allow me to logon.

Is  there a command  specific to SSH that is blocking me from accessing devices related to keys? my script worked with telnet , all i changed was the port number.

thanks for helping

1 Accepted Solution

Accepted Solutions

Liam Kenneally
Level 1
Level 1

Hi TFG_Cisco,

Im not to good with scripting but, if you JUST changed the port number from 23 to 22 for example that will not be enough.

Telnet call both username and password. for example  telnet 10.10.10.10 then you will be prompted for a username and password...

With SSH. you need to specify the user with  -l tag. for example ssh -l admin 10.10.10.10 then you will be prompted for just the password.

So I assume at the moment your script has 3variables:-

$IP_ADD

$USR_NAME

$PASSWORD

You will need to add another variable to add the -l before $USR_NAME tag, for SSH logins. OR have the variable add the -l automatically before the username if the script will not be used for telnet again

Let me know if this helps.

Ignore the above, I think the issue you are having is discussed in the link below.

http://www.orcsweb.com/blog/james/fun-with-powershell-plink-cisco-ios-and-powershell/

Kind Regards,

Liam

View solution in original post

1 Reply 1

Liam Kenneally
Level 1
Level 1

Hi TFG_Cisco,

Im not to good with scripting but, if you JUST changed the port number from 23 to 22 for example that will not be enough.

Telnet call both username and password. for example  telnet 10.10.10.10 then you will be prompted for a username and password...

With SSH. you need to specify the user with  -l tag. for example ssh -l admin 10.10.10.10 then you will be prompted for just the password.

So I assume at the moment your script has 3variables:-

$IP_ADD

$USR_NAME

$PASSWORD

You will need to add another variable to add the -l before $USR_NAME tag, for SSH logins. OR have the variable add the -l automatically before the username if the script will not be used for telnet again

Let me know if this helps.

Ignore the above, I think the issue you are having is discussed in the link below.

http://www.orcsweb.com/blog/james/fun-with-powershell-plink-cisco-ios-and-powershell/

Kind Regards,

Liam