When i do rsh i give it two commands:
rsh <host> setenv $myPath; $mySecCommand >> <filename>
that works perfect when i set the .rhosts file on the target host. But when i dont set the .rhosts file it gives me an error message, but it seems like it can do the setenv anyway and i get what i want, without the correct permissions? Is this a "hole" in the sequrity. Because doing it this way i actually dont need the .rhosts file. I get what i want even if it complains.
The command posted runs two separate commands on the local computer, one of which is a "rsh". The semi-colon is actioned locally, as is the ">> <filename>".
After the semi-colon is executed locally.
The "rsh" is itself a local command but the parameters (in this case up to the semi-colon) are executed on the remote machine as shell commands.
If we escape the semi-colon the second command gets executed on the remote computer too. The log file still gets created on the local computer.
If we escape the ">>" the log file should get created on the remote computer.
It is better to use the "-n" switch to "rsh" to be 100% sure what is going to happen to any i/o. For example.
To me personally this is all academic. For anything beyond the simplest command line I would put the commands into a script on the remote machine and execute the script with:
The script itself would contain a shebang line and anything needed to set up a suitable environment to run the process.
A quick way to check which computer a command is executed on:
rsh remote_machine -n "uname -n";uname -n
rsh remote_machine -n "uname -n"\;"uname -n"
Last edited by methyl; 04-30-2010 at 01:08 PM..
Reason: Last rsh line was wrong.
After the semi-colon is executed locally.
The "rsh" is itself a local command but the parameters (in this case up to the semi-colon) are executed on the remote machine as shell commands.
If we escape the semi-colon the second command gets executed on the remote computer too. The log file still gets created on the local computer.
If we escape the ">>" the log file should get created on the remote computer.
It is better to use the "-n" switch to "rsh" to be 100% sure what is going to happen to any i/o. For example.
To me personally this is all academic. For anything beyond the simplest command line I would put the commands into a script on the remote machine and execute the script with:
The script itself would contain a shebang line and anything needed to set up a suitable environment to run the process.
A quick way to check which computer a command is executed on:
rsh remote_machine -n "uname -n";uname -n
rsh remote_machine -n "uname -n"\;"uname -n"
Thanks, this was really helpfull and also an eye opener
Hello I have a LPAR AIX 6.1 on Power VM, Vio 2.2.3 and when I execute a rcp to this machine, I cant, simultaneosly, rlogin, telnet, rsh to this same LPARt. This commands stay hanged till the copy end, and Imeddiatlely the comand is executed (rlogin, telnet, rhs, etc).
Someone can give me... (1 Reply)
Hi,
i want to write script where it will login into 50 hosts and if login is successful it print message "login to host1 is
successful" if not it should print message "Not able to login to host1". once connection to the host is succesful it should fire df command to check filesystem if df is... (3 Replies)
Hello ,
I have a problem which involves a set of command should be executed on remote host and output should be stored in a file. But due to security reason I can not use expect to enter the password and its not possible to create password less login for multiple user to do the same thing and we... (10 Replies)
Hi
Can i ask?
I had multiple solaris workstation running and some local users using it. Is it possible to bind to the local user terminal or console he's using as if like the user well type and I can see it and what my typing in the local user see it also.
Is it possible..
Thanks. (3 Replies)
Hi guys.
i need some help, i need to create a script in tcsh that rsh into all my hosts that we have at our business, then cd to a directory (cd /apps/users) then grab a file from the users folder and ftp it back to my windows machine. can someone please help?
Kind regards.
Brian Behrens (2 Replies)
Hi Gurus
I have a few Sol 5.9 servers and i have enabled password less authentication between them for my user ID. Often i have found that when my password has expired,the login fails.
Resetting my password reenables the keys.
Do i need to do something to avoid this scenario or is this... (2 Replies)
Dear forum,
First off, I'm using Solaris 5.6 UNIX. I'm trying to write a script which will connect to remote computers on a network (by specific IP's from a hosts file) and will run a separate script which is installed in each of the remote computers. My problem is that to run the script in the... (1 Reply)
Hello,
I am currently trying to execute a command in a Windows machine from a UNIX server. In order to do this, I am using the RSH command in UNIX but whenever i do this I am getting this error "RSHD: <username>: could not retrieve password: Please login and run rsetup."
I log in via the... (0 Replies)
Hi Guys,
I'm having a problem trying to change to a different user within a script .
I want to change to a specific user and then run the subsequent commands using his previleges .
I remember having used ' su ' some years back for this , can't figure it out now !!
Help appreciated . (3 Replies)