- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SSH: how to perform a remote command with a parame...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО08-27-2003 11:54 PM
тАО08-27-2003 11:54 PM
I make use of ssh since a couple of months.
Now we try to run the following command using ssh :
serverA # ssh -ttt server1 "/sbin/init.d/logsurfer restart"
Now looking at server1 I can see the command comming in :
sh -c /sbin/init.d/logsurfer restart
Now it doesn't work, when I perform this command manualy it also doesn't work as it needs to be quoted :
sh -c "/sbin/init.d/logsurfer restart"
I tried several ways to get ssh report the command quoted to the remote machine, so as one command. Unfortunetly this never worked out. Anyone a suggestion ?
Best Regs David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 12:12 AM
тАО08-28-2003 12:12 AM
Re: SSH: how to perform a remote command with a parameter
Try to run:
ssh -ttt server1 "\"/sbin/init.d/logsurfer restart\""
regards,
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 12:18 AM
тАО08-28-2003 12:18 AM
Re: SSH: how to perform a remote command with a parameter
Thanks for the input!
Unfortunetly I tried this as well, and please see the result. I can asure you this is the exact command !!
Regs David
# ssh -ttt server1 "\"/sbin/init.d/logsurfer restart\""
sh: /sbin/init.d/logsurfer restart: not found.
Connection to server1 closed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 12:26 AM
тАО08-28-2003 12:26 AM
Re: SSH: how to perform a remote command with a parameter
Is it possible for you to try the command with the ksh instead the sh?
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 01:46 AM
тАО08-28-2003 01:46 AM
Re: SSH: how to perform a remote command with a parameter
I can give it a /bin/ksh previous to the command to perform, but it gives me, with or without quotes, the same errors.
Unfortunetly ssh invokes the sh -c on the remote system, so that will not be possible to change.
Any other suggestions? :)
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 01:54 AM
тАО08-28-2003 01:54 AM
Re: SSH: how to perform a remote command with a parameter
the "not found" is because with the "" the command is interpreted as a whole command, not a command plus parameteres.
Why do you repeat 3 times the -t (-ttt)?
easy solution, but not nice: create two script that perform
"logsurfer stop" and "logsurfer start"
nicer: tear away the "" :)
ssh -ttt server1 /sbin/init.d/logsurfer restart
it works for me (besides -tt).
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 02:33 AM
тАО08-28-2003 02:33 AM
Re: SSH: how to perform a remote command with a parameter
I've seen a similar problem with ssh though, didn't realize this could be the cause. ssh calls use the Posix Shell?
-t says its to force psuedo terminal allocation.
what about -T to force it not to do that. Your script is a root startup script, it doesn't need a psuedo terminal.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:04 AM
тАО08-28-2003 03:04 AM
Re: SSH: how to perform a remote command with a parameter
I confirm, you must be good. But a restart now works, but I just never get back my prompt :(
So initiating a :
ssh -T server1 "/sbin/init.d/logsurfer restart"
does restart logsurfer, but never gives back my # (prompt). Any ideas.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:11 AM
тАО08-28-2003 03:11 AM
Re: SSH: how to perform a remote command with a parameter
man page has a few possible options for termination:
~. Disconnect
~^Z Background ssh
~# List forwarded connections
Can't say I know how to implement it. This thread interests me because I have an ssh call core dumping right now and I need to figure out how to get it to use the Korn shell, because the app thats dumping needs that shell.
If this finishes, post back the final resolution.
sEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:35 AM
тАО08-28-2003 03:35 AM
Re: SSH: how to perform a remote command with a parameter
ssh -f -T server1 "/sbin/init.d/logsurfer restart"
See what happens.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:39 AM
тАО08-28-2003 03:39 AM
Re: SSH: how to perform a remote command with a parameter
ssh -f -T server1 "/sbin/init.d/logsurfer restart"
So, that's mine. Steve, you still should be able to do the following :
ssh
Maybe this can be your solution.
Thanks for your help in it !! If you have a core file you can send it to me and I'll try to analyze it. Just let me know if you need my help in it.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2003 03:42 AM
тАО08-28-2003 03:42 AM
Re: SSH: how to perform a remote command with a parameter
We were all typing the same solution at the same time, so three people found the same solution. Who is giving me points :)
For al other persons. Case closed, information shareable.
Regs David