- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: C++ getting info via SSH2
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
11-10-2003 06:52 AM
11-10-2003 06:52 AM
I have a C++ program making a connection to a unix server via SSH2 as follows:
system('ssh2 host -l uname -W Password.txt &)
A dos command window is launched and then I am stuck. I can go to the dos command window and do whatever. I need however to keep using the C++ program in order to get information (like get a file, chandge directories, or run a script). Do you know how can I achieve this? Are there any examples I can refer to out there?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2003 07:01 AM
11-10-2003 07:01 AM
Re: C++ getting info via SSH2
system('ssh2 host -l uname -W Password.txt myscript.sh &)
This would allow you to login and run what you need to and return the result to your calling program on stdout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2003 07:27 AM
11-10-2003 07:27 AM
Re: C++ getting info via SSH2
Yes it did! And I thought it would not take a script as a command, because I passed before the 'llogin' command and it would not take it:
system('ssh2 host -l uname -W Password.txt llogin&)
But, it did take a simple script I created:
system('ssh2 host -l uname -W Password.txt simple.csh &)
The script merely echoes a welcome message and displays a date. So, in the DOS command window I get back the welcome message and the date, but the connection does not remain open; that is, the prompt is at my local Widnows path, which I do not know if it is a problem or not.
What I need to do on the Unix is to read some files, manipulate them on Windows through the C++ program, and then put the modified files back.
Any ideas?
Thank you,
--Cecilia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2003 07:37 AM
11-10-2003 07:37 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2003 07:59 AM
11-10-2003 07:59 AM
Re: C++ getting info via SSH2
Thanks,
--Cecilia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2003 08:27 AM
11-10-2003 08:27 AM
Re: C++ getting info via SSH2
You may want to take a look at this website for usage details.
http://www.openssh.org/manual.html