HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- openssh client, How can I do something like...
Operating System - HP-UX
1833883
Members
1641
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2002 04:08 PM
01-12-2002 04:08 PM
openssh client, How can I do something like...
... I'd like to connect to another host from my server, using ssh command in a perl script, so the problem is: How can I pass the password when it is prompted? like this:
ssh theuser@theHostToConnect [command that I want]
but when I run this, the command is executed after I enter the password, but I want to pass the password by argument too.
something like:
ssh -l user -pass password host command
note that -pass option doesn't exist, just for exemple...
Any clue?
ssh theuser@theHostToConnect [command that I want]
but when I run this, the command is executed after I enter the password, but I want to pass the password by argument too.
something like:
ssh -l user -pass password host command
note that -pass option doesn't exist, just for exemple...
Any clue?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2002 04:13 PM
01-12-2002 04:13 PM
Re: openssh client, How can I do something like...
I want this:
#!/usr/bin/perl -w
...
...
system ("ssh theuser@theHostToConnect [command that I want]");
...
...
but the password to authentication, I don't know how can I pass...
#!/usr/bin/perl -w
...
...
system ("ssh theuser@theHostToConnect [command that I want]");
...
...
but the password to authentication, I don't know how can I pass...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2002 05:49 PM
01-12-2002 05:49 PM
Re: openssh client, How can I do something like...
Hi,
Generate public keys by "theuser" on "theHostToConnect" using ssh-keygen and append the identity.pub under .ssh directory to authorized_keys of "theHostConnectingFrom". This will work like remsh and will only prompt for passphrase. You can make your system to remember the passphrase by running ssh-agent and then add the passphrase using ssh-add. Then you won't get any further prompts in your script.
Otherwise, you need to use tools like expect to convert interactive programs to non-interactive. Here it is
http://hpux.asknet.de/hppd/hpux/Tcl/expect-5.33/
Look at the dependencies..
-Sri
Generate public keys by "theuser" on "theHostToConnect" using ssh-keygen and append the identity.pub under .ssh directory to authorized_keys of "theHostConnectingFrom". This will work like remsh and will only prompt for passphrase. You can make your system to remember the passphrase by running ssh-agent and then add the passphrase using ssh-add. Then you won't get any further prompts in your script.
Otherwise, you need to use tools like expect to convert interactive programs to non-interactive. Here it is
http://hpux.asknet.de/hppd/hpux/Tcl/expect-5.33/
Look at the dependencies..
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP