Sponsored Content
Top Forums UNIX for Advanced & Expert Users 2 users on the same server (rexec) Post 87127 by Anta on Thursday 20th of October 2005 08:18:26 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
rexec(3)						     Library Functions Manual							  rexec(3)

NAME
rexec, rexec_r - Allow command execution on a remote host LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <netdb.h> #include <unistd.h> int rexec( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc); The following function is supported in order to maintain backward compatibility with previous versions of the operating system. int rexec_r( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc, struct hos- tent_data *host_data); PARAMETERS
Contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.conf file. If the name of the host is not found in either file, the rexec() fails. Specifies the well-known Internet port to use for the connection. A pointer to the structure that con- tains the necessary port can be obtained by issuing the following library call: getservbyname("exec", "tcp") Points to a user ID that is valid on the host. Points to the password of the specified user ID on the host. Points to the name of the command to be executed at the remote host. Specifies the file to which standard error from the remote command is sent. If the err_file_desc parameter is 0 (zero), the standard error of the remote command is the same as standard output. No provision is made for sending arbitrary signals to the remote process. In this case, however, it may be possible to send out-of-band data to the remote com- mand. If the err_file_desc parameter is nonzero, an auxiliary channel to a control process is set up, and a descriptor for it is placed in the err_file_desc parameter. The control process provides diagnostic output from the remote command on this channel and also accepts bytes as signal numbers to be forwarded to the process group of the command. This diagnostic information does not include remote authorization failure, since this connection is set up after authorization has been verified. Per-thread data for reentrant version. DESCRIPTION
The rexec() (remote execution) function allows the calling process to execute commands on a remote host. If the rexec() connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to the remote command as standard input and standard output. The user and passwd parameters specify a valid user ID and the associated password for that user on the remote host. If the user and passwd parameters are not supplied, the rexec() function takes the following actions until finding a user ID and password to send to the remote host: It searches the current environment for the user ID and password on the remote host. It searches the user's home directory for a file called $HOME/.netrc that contains a user ID and password. It prompts the user for a user ID and password. Note that action 3 does not apply when using rexec_r(). NOTES
The rexec_r() function is the reentrant version of rexec(). It is supported in order to maintain backward compatibility with previous ver- sions of the operating system. The netdb.h header file defines the hostent_data structures. RETURN VALUES
Upon successful completion, the system returns a socket descriptor to the remote command. Otherwise, a value of -1 is returned, indicating that the specified hostname does not exist. FILES
Contains hostnames and their addresses for hosts in a network. This file is used to resolve a hostname into an Internet address. Contains the name server and domain name. Contains automatic login information. RELATED INFORMATION
Functions: getservbyname(3), rcmd(3), rresvport(3), ruserok(3). Commands: rexecd(8). delim off rexec(3)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy