- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 2 separated ssh questions
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
07-23-2004 06:15 AM
07-23-2004 06:15 AM
2 separated ssh questions
ssh root@server_a "cmd1; cmd2; cmd3"
The command is successfuly completed the task on remote server server_a, however, the only problem is I dont get the prompt back on my local system. I have to hit "ctl-c" to get it back. why?
2. This question is not related above problem. In my another separated ssh command:
ssh root@server_b "/full/nameot/xyz -f"
xyz is my own script and can have "-f" option. Also xyz script would also produce two output files on the remote server. However, the script was not actually executed, and no any output files were produced. Why?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 06:32 AM
07-23-2004 06:32 AM
Re: 2 separated ssh questions
fir the second question, do you get your prompt back after your xyz script looked like it ran fine ? If so, place a set -x at the top of your script on the remote server and see if your script gets entered into or is it just denying you the ssh login as root.
when you talk about root login via remote commands, it is always tricky as more than one thing can go wrong to deny access.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 06:41 AM
07-23-2004 06:41 AM
Re: 2 separated ssh questions
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 06:49 AM
07-23-2004 06:49 AM
Re: 2 separated ssh questions
set -x
That will give you details
Also run the ssh with the -v switch. This will give you a better idea of whats going on.
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
07-23-2004 07:00 AM
07-23-2004 07:00 AM
Re: 2 separated ssh questions
all cmd's works file on the local system, and again, they are all completed fine when I put them in the ssh command. The only problem is I could not get the prompt back when I run the ssh on the local, and run cmd1, 2, and 3 remotely on the remote server.
I did put "set -x" in front of cmd1, and did not find anything unusal.
Is there any option in ssh and it could force the ssh to be terminated?
With regards my 2nd question, again, the script doesn't seem to every started at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 07:04 AM
07-23-2004 07:04 AM
Re: 2 separated ssh questions
when I add -v in ssh command, the last line is shown on the screen is the folloing:
"debug: client_input_channel_req: channel 0 rtype exit-status reply 0", and the cursor is just stop there, could not get the prompt back. Any idea, what is this message for?
As I repeatedly say, all cmd's in ssh were successful on the remote server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 07:29 AM
07-23-2004 07:29 AM
Re: 2 separated ssh questions
First, does any command on the remote script run any jobs in the background ? That may be one of the reasons for this behaviour.
Also, what happens if you run the "ssh .." command with nohup. Do you still have the problem ?
Or try re-directing the output to >/dev/null 2&1
This openSSH FAQ might be helpful.
http://www.openssh.com/faq.html#3.10
regds,
abdul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 08:13 AM
07-23-2004 08:13 AM
Re: 2 separated ssh questions
No, no any commads running in backgound on the rmote site. Also, the issue is existing when I run the ssh... on any servers.
The web site you are refering to doesn't help.
I know that sshd needs to tell the exit status from command to ssh, but the last command, cmd3 IS successful, and I thought that it'd be enough tell sshd "I'M DONE".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2004 08:29 AM
07-23-2004 08:29 AM
Re: 2 separated ssh questions
Does it end normally ?
Is this something new.. ? may be restart sshd daemon..(windows solution;-)
Or update to a later version of openSSH ..
regds,
Abdul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2004 09:31 AM
07-26-2004 09:31 AM
Re: 2 separated ssh questions
Any other idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 03:51 AM
07-27-2004 03:51 AM
Re: 2 separated ssh questions
Does a normal ssh root@unknown "ls" exit properly?
How about running ssh root@unknown "cmd1 && cmd2 && cmd3" see if all scripts are run?
rgds,
-=ChaZ=-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2004 07:18 AM
08-09-2004 07:18 AM
Re: 2 separated ssh questions
ssh root@remotename "cp /etc/rc.config.d/nfsconf /etc/rc.config.d/nfsconf.orig && sed 's/AUTOMOUNT=1/AUTOMOUNT=0/' /etc/rc.config.d/nfsconf > /tmp/nfsconf && cp /tmp/nfsconf /etc/rc.config.d/nfsconf && /sbin/init.d/nfs.cleint stop && /sbin/init.d/nfs.cleint start"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2004 08:02 AM
08-09-2004 08:02 AM
Re: 2 separated ssh questions
Looking at the 'chain' of commands in the quotes, I would strongly recommend you to run the commands in a shell script than all in one command line.
This may work in a normal setting, but since you are having problems returning it with ssh, why don't you try making a shell script with all commands ina separate line and see what happens.
Your problem here may be due to Ssh confused with the syntax or not getting he correct return status in the way it xpected it.
regds,
Abdul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2004 08:23 AM
08-09-2004 08:23 AM
Re: 2 separated ssh questions
Aha! I have stumbled onto this a number of times in the past.. it is still a "problem".
If you ssh to a server and execute a script of the like in the "/sbin/rc.?/xxx start/stop" .. after you log off that SSH connection , you WILL NEVER be brought back to your shell/terminal where you invoked ssh from...
Try it.. it happens with SSH distributions on HP and SUN.. I have not been able to explain such behaviour...