question

emre avatar image
emre asked AmeyaB answered

How to login(sending Credentials) to a SSH session in command line

Is it possible to login(sending username and password) to a SSH session from Command Line? I do not want to define my user and password before opening my session. Neither in test topology file(hardcoded values) nor on the SSH open session step(in step properties->SSH Session Properties->SSH etc). I want to send my username and password in command line as telnet.

For example if I use putty to manage my ssh sessions, For login, it opens a command line and requests for my username and password in the command line, but in itest unfortunately it has to be done either via topology file(hardcoded variables) or by defining user and password before open session step and setting them in open step properties(->SSH Session Properties->SSH etc). but it is not possible to enter them in a command line.

Is there a workaround for it?

Thanks a lot in advance.

sshsessionlogincommand line (cli)opening a session
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

AmeyaB avatar image
AmeyaB answered

@emre I assume you are doing this because you don't know the credentials before hand - if that's the case, you can use variables. For example in the open for the ssh, you can override the username and password using $user and $password, and then before the open step you can set these variables to be whatever you want them to be.

If that's not the use case, can you describe more the use case where you wan to send the credential from command line?

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bhavani.geepalem avatar image
bhavani.geepalem answered

Currently in iTest, we do not have an option to login SSH session through Command Line.

The only way is to use SSH session and we need to specify the Username & Password before starting the session.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.