Sponsored Content
Full Discussion: rsh command - ksh
Top Forums Shell Programming and Scripting rsh command - ksh Post 302508621 by ctsgnb on Monday 28th of March 2011 02:31:28 PM
Old 03-28-2011
do you have an account on server2 ? is it macc or macc1 ?
maybe your home directory it different from one server to another
can you just
Code:
rsh server2
pwd
id

(this will defaultly log in with your local user name (the one you are logged on server1 : macc)
or

Code:
rsh server2 -l macc1
pwd
id

do one of those work ? which ?

Maybe you should load your environment from within the script you want to run.
This User Gave Thanks to ctsgnb For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Rsh command

Newbie here, I want to add a line to our 3D rendering scripts that will send an email to the animators once a scene has finished rendering. The 3D scripts are on the client hosts and the sendmail setup on the server. I tried using a rsh line in the script as follows rsh root@blah echo... (2 Replies)
Discussion started by: flamethrower
2 Replies

2. UNIX for Dummies Questions & Answers

rsh command

Hi, I'm performing a data migration from an Ingres db to an Oracle db. The ingres database lives on a unix host running "UNIX(r) System V Release 4.0 (SunOS 5.5.1) ", while the Oracle database lives on another unix host running "SunOS 5.8". Part of the migration is to remotely run Oracle's... (1 Reply)
Discussion started by: strpeski
1 Replies

3. UNIX for Dummies Questions & Answers

.rhosts and rsh command

Hello all, Ok. Here it the scope I have two Redhat 7.2 machine which I use to test things on. I have a home directory which is NFS mounted via NIS. I have a .rhosts file in the directory with the name of the machine and username, with permission 600. Be when I try to run a rsh command I get... (6 Replies)
Discussion started by: larry
6 Replies

4. Shell Programming and Scripting

rsh command in a while loop

Hi , reading a "file1" with 2 data in each line (VAR1 and VAR2) , i'm using a while loop like this : cat file1|awk '{print $1,$2}'|while read VAR1 VA2 do echo $VAR1 echo $VAR2 done as this example shows , it works but if between do and done i use a "rsh" command , the script reads... (6 Replies)
Discussion started by: Nicol
6 Replies

5. Shell Programming and Scripting

RSH command

Hello, I am trying to determine 2 things on a remote host. 1. Is file a directory or file 2. Does the file or directory exist Not too familiar with "find" command although I believe that may be a possible way. I have tried: remsh "$HOST" test -e /home/test.script && echo "yes" This... (3 Replies)
Discussion started by: bestbuyernc
3 Replies

6. Shell Programming and Scripting

rsh problem in ksh

On a SUN cluster (ksh - Solaris 8 SPARC) I run a script which at some time has to perform a rsh command on the alternate node but with some other user (let's say "oper") so it should be like: rsh su - oper -c APP_COMMAND -paramters When I run the script APP_COMMAND is done but without taking... (2 Replies)
Discussion started by: heartwork
2 Replies

7. UNIX for Dummies Questions & Answers

rsh command

Hi, I am a beginner and i want to seek help I want to use the rsh command. Is there a possibility that i can do it without the system password I am planning to make a csh script that could browse/copy files from diferent workstations. thank you.... (5 Replies)
Discussion started by: wramonzon
5 Replies

8. Linux

rsh command

we want to execute remote script via rsh (we just only should use rsh except others),but rsh command can not set environment variable for specify user, then scripts can not be executed correctly,anyone knows how to fix this problem? thanks. (8 Replies)
Discussion started by: Frank2004
8 Replies

9. Solaris

Problems with rsh command

Hello guys, I have a script in a Linux server, from where I go to 3 Sun servers and run process. Now i have done an upgrade and increase 1 Sun server more, now i need to run the shell in the Linux Server (into the shell is rsh command), but when i try to do ir with the new Sun server, i hace the... (3 Replies)
Discussion started by: lestat_ecuador
3 Replies

10. Shell Programming and Scripting

rsh command

Hi Does anybody know how to to return the exit code of a remote command when using rsh? I know that "rsh" has no built-in ability for that. The echo $? is showing the results of the rsh command. Not the remotely executed command. I am trying to get the return code of psef command from... (4 Replies)
Discussion started by: aoussenko
4 Replies
rsh(1M) 						  System Administration Commands						   rsh(1M)

NAME
rsh, restricted_shell - restricted shell command interpreter SYNOPSIS
/usr/lib/rsh [-acefhiknprstuvx] [argument...] DESCRIPTION
rsh is a limiting version of the standard command interpreter sh, used to restrict logins to execution environments whose capabilities are more controlled than those of sh (see sh(1) for complete description and usage). When the shell is invoked, it scans the environment for the value of the environmental variable, SHELL. If it is found and rsh is the file name part of its value, the shell becomes a restricted shell. The actions of rsh are identical to those of sh, except that the following are disallowed: o changing directory (see cd(1)), o setting the value of $PATH, o pecifying path or command names containing /, o redirecting output (> and >>). The restrictions above are enforced after .profile is interpreted. A restricted shell can be invoked in one of the following ways: 1. rsh is the file name part of the last entry in the /etc/passwd file (see passwd(4)); 2. the environment variable SHELL exists and rsh is the file name part of its value; the environment variable SHELL needs to be set in the .login file; 3. the shell is invoked and rsh is the file name part of argument 0; 4. the shell is invoke with the -r option. When a command to be executed is found to be a shell procedure, rsh invokes sh to execute it. Thus, it is possible to provide to the end- user shell procedures that have access to the full power of the standard shell, while imposing a limited menu of commands; this scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the .profile (see profile(4)) has complete control over user actions by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands (that is, /usr/rbin) that can be safely invoked by a restricted shell. Some systems also provide a restricted editor, red. EXIT STATUS
Errors detected by the shell, such as syntax errors, cause the shell to return a non-zero exit status. If the shell is being used non- interactively execution of the shell file is abandoned. Otherwise, the shell returns the exit status of the last command executed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
intro(1), cd(1), login(1), rsh(1), sh(1), exec(2), passwd(4), profile(4), attributes(5) NOTES
The restricted shell, /usr/lib/rsh, should not be confused with the remote shell, /usr/bin/rsh, which is documented in rsh(1). SunOS 5.10 1 Nov 1993 rsh(1M)
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy