• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

Solaris OpenSSH clinet command line password

Does anyone know how to pass a password via command line with OpenSSH for Solaris?

4 Solutions
openssh does not accept password on command line, for obvious reson ;-)
use a key instead
man ssh-keygen
man ssh-add
man ssh-agent
If you are using script to run ssh remote command, you can write an expect script to handle the password or setup ssh login without password.

to setup ssh without password, have a look at the procedures in:

To use expect, you can download expect from:

then use "autoexpect" to create an expect script and then modify the script.
man autoexpect
to learn more details
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

factsmgtAuthor Commented:
Does anyone know of an ssh client that will run on Solaris that supports the passing of the password via command line?
Passing a password on the command line is insecure. If you are running SSH, you care about security. Therefore you should never pass a password on the command line.

SSH addresses this problem by supporting keys for autehthentication. Use them.
You can pass the passwd as a commandline arg to an expect script to use ssh, but is
 insecure as mentioned in chris_calabrese's comment.

other user can simply use "ps" command with -o args to read your password!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now