2 users on the same server (rexec)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users 2 users on the same server (rexec)
# 1  
Old 10-20-2005
2 users on the same server (rexec)

Hi, all.

Could some one help me please with one problem?

In one process (on aix) I should run some remote scripts on other server via rexec.

Some scripts should be run on server1 under useridA, and some scripts should be run on the same server under useridB.
I specified in .netrc server-name/useridA in one line and server-address/useridB in second line.
When I call
rexec server-name some-command
everything is okay.
But when I try to run
rexec server-address some-command
it looks like rexec selects useridA instead of useridB.
In /etc/hosts I can see:
server-address server-name

Is it possible to avoid it?
I mean to say if it's possible to perform some job via rexec on the same server but under different userids?

Thank you in advance.

Anta
# 2  
Old 10-21-2005
Do not use rexec and DO NOT USE .netrc-files at all, they are a severe security hole.

Install ssh on all machine (download at www.bullfreeware.com for instance), exchange keys and then issue:

Code:
#!/bin/ksh

ssh remoteserver -l userA "who am i"

ssh remoteserver -l userB "who am i"

exit 0

Hope this helps.

bakunin
# 3  
Old 10-21-2005
Thank you.
Yes, I don't like all this .netrc using too.
I realize it would be simpler to deal with ssh, but the problem is this moment I need use rexec.
It's possible to trick rexec with all this stuff like klog, HOME vars, but sure - it's just a fallacious way.

Anta
# 4  
Old 10-21-2005
Quote:
Originally Posted by Anta
Thank you.
this moment I need use rexec.
In this case: use rsh:

rsh <host> -l <user> <command>

watch out: there is a kerberized an a non-kerberized version of it, depending on if you have kerberos installed or not.

HTH

bakunin
# 5  
Old 10-21-2005
Thank you.
You'll laugh, but in our environment rsh using has been outlawed last and all the time.
Maybe the best way is to create own wrapper for rexec system function.
Anta
# 6  
Old 10-21-2005
I think you're supposed to put both lines in .netrc. And then do:
rexec -l usera
rexec -l userb
The rexec program is a bit non-standard. I have only seen it on HP-UX. I don't see any indication that you tried a -l option. Does the AIX rexec program not have a -l option?

I have a c wrapper somewhere that reads the password from stdin. I use in scripts where I prompt for the password and then echo it into my wrapper. If you have a c compiler, I could dig it up.
# 7  
Old 10-24-2005
Thank you.

To my regret there is not "l" option in aix/rexec.
Yes, it's not a large problem to create own wrapper for rexec system function in order to have the possibility to specify the need userid, but I hoped my problem could be solved with a minimal effort. Alas...

Anta
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Slow login with rexec.

Hi all, I´m replacing an old linux enterprise redhat 4.5 by a new one linux enterprise redhat 6. In both I use rexec as a communication between the front end and the user. In the old one, when the user connects, the communication establishes quickly (less than 3 sec). But in the new one, the... (1 Reply)
Discussion started by: mig28mx
1 Replies

2. UNIX for Advanced & Expert Users

Rexec Issue

Hi Team, I am executing some ksh scripts which inturn calls java files in AIX Environment. We have installed java6_64 which is in .profile. But when we execute from rexec its taking path from some different place that does not have java in $PATH variable. Can you please help me find out which... (2 Replies)
Discussion started by: balasubramani04
2 Replies

3. Red Hat

when users ftp to server the timezone reflected is UTC but the server is set to TZ in localtime

Guys, Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session. I am using RHEL 5.3. root@]# ll total 1740... (2 Replies)
Discussion started by: shtobias
2 Replies

4. AIX

rexec - other options?

Rexec executes commands one at a time on a remote host. The rexec command provides an automatic login feature by checking for a $HOME/.netrc file. User and password are stored in $HOME/.netrc. I would like to log on to another host and execute a script/command but not using $HOME/.netrc file,... (4 Replies)
Discussion started by: ioniCoder
4 Replies

5. UNIX for Dummies Questions & Answers

launching script via REXEC

Hi folks! my client uses an winapplication which is launching shell-scripts remotely on a HP-Unix Machine via Rexec. The application-configuration is launching the script (which is in the home directory of connecting user) like: rexec host user pass shell.sh So far so good, everything... (3 Replies)
Discussion started by: JohnMurdoch
3 Replies

6. UNIX for Advanced & Expert Users

reagrding REXEC command

Hi UNIX gurus..... have a doubt..can i run a script in a remote machine by using something like rexec add.corp.afg.com /aa/ss/remtescript I dont want to use the rsh command due to some security issues. thanx, rahul26 :) (2 Replies)
Discussion started by: rahul26
2 Replies

7. Solaris

Rexec

How is rexec enabled on a Solaris 8? How can I check if rexec is installed? (1 Reply)
Discussion started by: pmj1970
1 Replies

8. UNIX for Dummies Questions & Answers

Enabling Rexec ????

Can someone tell me how I would enable Rexec on a UNIX machine? And is the procedure different on the different systems - Solaris, HP-UX -etc. Thanks~!! mike (1 Reply)
Discussion started by: raichuu
1 Replies

9. Programming

rexec() function problem

Hi folks, I'm trying to make a reconnection algorithm using rexec(), but I noticed that when rexec() fails returning -1, it is impossible to make it run successfully again until you restart the program or the thread. Example, I have a endless loop for connection retries, if I supply a wrong... (7 Replies)
Discussion started by: lcmoreno
7 Replies

10. UNIX for Dummies Questions & Answers

expect (re: rexec)

In http://forums.unix.com/showthread.php?threadid=391 there is one statement called expect. but when I issue command whereis expect, respond from o/s only EXPECT: (only one world). I try to find it at /usr/bin, no expect statement there ? is it default unix o/s command ? I am using AIX on... (1 Reply)
Discussion started by: yatno
1 Replies
Login or Register to Ask a Question