1824971 Members
3588 Online
109678 Solutions
New Discussion юеВ

Using remsh

 
Tomek_1
Advisor

Using remsh

Hi,
I'd like to use remsh in my system and i want to set some env in profile but it works only when shell is /usr/bin/csh (i can set it in .cshrc). Where can i set it when shell is /usr/bin/sh.

Rgds.
Tom
6 REPLIES 6
Animesh Chakraborty
Honored Contributor

Re: Using remsh

for /usr/bin/sh it is .profile
Did you take a backup?
Tomek_1
Advisor

Re: Using remsh

It does not work with remsh
Patrick Chim
Trusted Contributor

Re: Using remsh

Hi,

You have to modify security files for your need.

Please man .rhosts and hosts.equiv for more details.

Regards,
Patrick
Leif Halvarsson_2
Honored Contributor

Re: Using remsh

Hi

This is a method to set enviroment for remsh if using sh (from man pages of remsh).

If the remote shell is /usr/bin/sh, the following command line sets up
the environment for the remote command before executing the remote
command:
remsh otherhost . .profile 2>&- \; command

Tomek_1
Advisor

Re: Using remsh

Ok, but /usr/bin/csh doesn't need that and automatically executes .cshrc, and want it in /usr/bin/sh

Rgds
Jordan Bean
Honored Contributor

Re: Using remsh


.cshrc (csh) is not to .profile (sh). Instead, .login (csh) is to .profile (sh). The equivalent to .cshrc in korn and posix requires that the env var ENV be set to a valid file path.

Create the file, say, ~/.kshrc. Then try this:

remsh host 'ENV=~/.kshrc ksh -c ls'