- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: remsh works but not from a script
Operating System - HP-UX
1752811
Members
6351
Online
108789
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
Discussions
Discussions
Forums
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
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
тАО04-05-2011 06:17 AM
тАО04-05-2011 06:17 AM
remsh works but not from a script
Hi,
This command works right:
/usr/bin/remsh host1 "uname -a" :
/usr/bin/remsh host1 "uname -a"
SunOS host1 5.8 Generic_
..but if I execute it from inside a script:
(sleep 2
echo "uname -a"
sleep 2
echo exit
sleep 2 ) | /usr/bin/remsh host1
..it does not work:
Not on system console
Connection closed.
The script works in some systems and does not work in some others... What can be the problem?
Regards,
This command works right:
/usr/bin/remsh host1 "uname -a" :
/usr/bin/remsh host1 "uname -a"
SunOS host1 5.8 Generic_
..but if I execute it from inside a script:
(sleep 2
echo "uname -a"
sleep 2
echo exit
sleep 2 ) | /usr/bin/remsh host1
..it does not work:
Not on system console
Connection closed.
The script works in some systems and does not work in some others... What can be the problem?
Regards,
"When you look into an abyss, the abyss also looks into you"
- Tags:
- remsh
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2011 06:43 AM
тАО04-05-2011 06:43 AM
Re: remsh works but not from a script
Hi:
What happens if you use the '-n' option>
# remsh host1 -n
See the manpages for 'remsh'.
Regards!
...JRF...
What happens if you use the '-n' option>
# remsh host1 -n
See the manpages for 'remsh'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2011 06:44 AM
тАО04-05-2011 06:44 AM
Re: remsh works but not from a script
> This command works right:
Then perhaps you should use a similar command
in your script, instead of one like:
| /usr/bin/remsh host1
Read:
man remsh
As I understand it, "remsh" does different
things, depending on whether you give it a
command to run. In the "works right" case,
you did. In the "does not work" case, you
didn't. One way, you get a command run. The
other way, you get an interactive session,
which, apparently, runs into more
restrictions.
Then perhaps you should use a similar command
in your script, instead of one like:
Read:
man remsh
As I understand it, "remsh" does different
things, depending on whether you give it a
command to run. In the "works right" case,
you did. In the "does not work" case, you
didn't. One way, you get a command run. The
other way, you get an interactive session,
which, apparently, runs into more
restrictions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-05-2011 06:48 AM
тАО04-05-2011 06:48 AM
Re: remsh works but not from a script
Are you trying to do the poor man's version of "expect" functionality ? Otherwise I do not see any use for this method over running uname -a from a single line of remsh as in
remsh host1 uname -a
The reason you're getting the "Not on system console" messages is, most probably you are trying to login as root using a non-console device (tty/pty of some sort) and some systems are configured NOT TO allow root logins from non-console devices. Actually, it is a very good practice NOT TO let direct root logins from remsh/ssh/rlogin sessions in my opinion.
remsh host1 uname -a
The reason you're getting the "Not on system console" messages is, most probably you are trying to login as root using a non-console device (tty/pty of some sort) and some systems are configured NOT TO allow root logins from non-console devices. Actually, it is a very good practice NOT TO let direct root logins from remsh/ssh/rlogin sessions in my opinion.
________________________________
UNIX because I majored in cryptology...
UNIX because I majored in cryptology...
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP