- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /usr/bin/sh remsh budapest -l root -n "su - spmadm...
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
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
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-06-2006 02:23 AM
тАО11-06-2006 02:23 AM
Does anybody know why I can execute the following command from crontab?
remsh budapest -l root -n "su - spmadm -c ls"
When I try from command line all works fine, but from crontab it doesn't, so I tried to execute command using same shell crontab uses and I get this error:
# /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
/usr/bin/sh: remsh: Execute permission denied.
#
Any idea?
Thanks for your help.
Regards,
Carles
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 02:30 AM
тАО11-06-2006 02:30 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
Very often things don't work in cron because cron has no environment.
Check the PATH variable among other issues.
env > /tmp/env.regular.txt
The more the environment in the cron script looks like that file the metter chance you have of your script running right.
Also to make the environment work normally, I suggest this format:
remsh otherhost scriptname
scriptname contains the environment variables and the command line you wish to run inside the script.
Unrelated for security reasons I recommend you stop using remesh and ush ssh from openssh(Secure Shell) which has the same command line functionality but encrypted authentication and datastream.
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
тАО11-06-2006 02:32 AM
тАО11-06-2006 02:32 AM
Solutionyou have to either supply a search path or specify the path for the executables i.e.
/usr/bin/remsh budapest -l root -n"su - spmadm -c -ls"
Also double check permissions:
ll /usr/bin/remsh
( On my system -r-sr-xr-x 1 root bin )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 02:34 AM
тАО11-06-2006 02:34 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
Who are you when you execute your script?
Do you have a .rhost? on budapest?
You may have a few env to set...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 03:05 AM
тАО11-06-2006 03:05 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
I execute remsh using full path but command still fails.
Permissions are the same Peter Gordon said.
Connection to remote host work fine and I launched test as root user.
I don't think ENV is the issue as I'm just trying to launch a simple command like ls.
Finally, I can't change access method right now, so I need to fix issue.
Thanks to all for your support.
Regards,
Carles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 03:12 AM
тАО11-06-2006 03:12 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
I tried, and for me it works...
It shows that if you are to use su -, you will have to add a test for interactive shell to stop "not typewriter..." messages in output.
My config for it to work is using in root homedir of the remote box a .rhosts file
Here is the line in cronfile:
52 16 * * * remsh draco -l root -n "su - vbe -c ls">/home/vbe/cron.log 2&1
Here is what I see in my local homedir:
ant:/home/vbe $ ll cro*
-rw-r--r-- 1 root sys 547 Nov 6 16:52 cron.log
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 03:38 AM
тАО11-06-2006 03:38 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
I tested with my own account just now, as an idea for you to try to debug. the idea is to read your account's mail to see what cron has put there if any error. I suggest you try also, I found it coulnt execute because the previous test I did was with root and so the output file belonged to root and I (vbe) wasnt allowed to write to...
The interesting is the message cron gave:
Received: (from root@localhost)
by ant.ge.ch (8.9.3 (PHNE_34936)/8.9.3) id RAA18829
for vbe; Mon, 6 Nov 2006 17:25:00 +0100 (MET)
Date: Mon, 6 Nov 2006 17:25:00 +0100 (MET)
From: root@ant.ge.ch
Message-Id: <200611061625.RAA18829@ant.ge.ch>
Subject: cron
sh: /home/vbe/cron.log: Cannot create the specified file.
sh: 1: not found.
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
remsh draco -l root -n "su - vbe -c ls">/home/vbe/cron.log 2&1
What do you think? Give it a try?
You would have to put your user in the remote box root hoemdir/.rhosts etc...
But from then on we could try together and with others to comment your results
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 03:51 AM
тАО11-06-2006 03:51 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
typo ?
Should
" 2&1 "
be
"2>&1 "
This should resolve your "sh: 1: not found."
error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 03:58 AM
тАО11-06-2006 03:58 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
Yes you are right I missed > when typing (to fast...)
And was more concerned by the Cannot create message and couldnt figure out the next one, not realizing it was another error...
Many thanks again!
Have you a clue about Carles issue?
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 04:07 AM
тАО11-06-2006 04:07 AM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
So who are you logged in as when "it works from the command line"
and
Whose crontab is it being run from?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 08:54 PM
тАО11-06-2006 08:54 PM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
Sorry for delay in my reply, but we're doing migrating SAP at same time and we're quite busy...
I tested command using full path and it seems to work fine right now (note I execute remsh without full path).
Now I need to verify with other remote command I should launch every night at 01h GMT+1.
In case it works tonight, remsh issue will have been fixed. Otherwise issue could be in remote system and new command to execute instead remsh command.
Anyway, I'll keep you informed.
Thanks to all for your help.
Regards,
Carles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2006 06:21 PM
тАО11-09-2006 06:21 PM
Re: /usr/bin/sh remsh budapest -l root -n "su - spmadm -c ls"
Last night crontab worked fine after specifying remsh full path.
Thanks to all for your help!
Regards,
Carles