Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rcmdsh(3) [osx man page]

RCMDSH(3)						   BSD Library Functions Manual 						 RCMDSH(3)

NAME
rcmdsh -- return a stream to a remote command without superuser SYNOPSIS
#include <unistd.h> int rcmdsh(char **ahost, int inport, const char *locuser, const char *remuser, const char *cmd, const char *rshprog); DESCRIPTION
The rcmdsh() function is used by normal users to execute a command on a remote machine using an authentication scheme based on reserved port numbers using rshd(8) or the value of rshprog (if non-NULL). The rcmdsh() function looks up the host *ahost using gethostbyname(3), returning -1 if the host does not exist. Otherwise *ahost is set to the standard name of the host and a connection is established to a server residing at the well-known Internet port ``shell/tcp'' (or whatever port is used by rshprog). The parameter inport is ignored; it is only included to provide an interface similar to rcmd(3). If the connection succeeds, a socket in the UNIX domain of type SOCK_STREAM is returned to the caller, and given to the remote command as stdin, stdout, and stderr. RETURN VALUES
The rcmdsh() function returns a valid socket descriptor on success. Otherwise, -1 is returned and a diagnostic message is printed on the standard error. SEE ALSO
rsh(1), socketpair(2), rcmd(3), rshd(8) BUGS
If rsh(1) encounters an error, a file descriptor is still returned instead of -1. HISTORY
The rcmdsh() function first appeared in OpenBSD 2.0, and made its way into FreeBSD 5.0. BSD
September 1, 1996 BSD

Check Out this Related Man Page

RCMDSH(3)						   BSD Library Functions Manual 						 RCMDSH(3)

NAME
rcmdsh -- return a stream to a remote command without superuser SYNOPSIS
#include <unistd.h> int rcmdsh(char **ahost, int inport, const char *locuser, const char *remuser, const char *cmd, const char *rshprog); DESCRIPTION
The rcmdsh() function is used by normal users to execute a command on a remote machine using an authentication scheme based on reserved port numbers using rshd(8) or the value of rshprog (if non-NULL). The rcmdsh() function looks up the host *ahost using gethostbyname(3), returning -1 if the host does not exist. Otherwise *ahost is set to the standard name of the host and a connection is established to a server residing at the well-known Internet port ``shell/tcp'' (or whatever port is used by rshprog). The inport argument is ignored; it is only included to provide an interface similar to rcmd(3). If the connection succeeds, a socket in the UNIX domain of type SOCK_STREAM is returned to the caller, and given to the remote command as stdin, stdout, and stderr. RETURN VALUES
The rcmdsh() function returns a valid socket descriptor on success. Otherwise, -1 is returned and a diagnostic message is printed on the standard error. SEE ALSO
rsh(1), socketpair(2), rcmd(3), rshd(8) HISTORY
The rcmdsh() function first appeared in OpenBSD 2.0, and made its way into FreeBSD 4.6. BUGS
If rsh(1) encounters an error, a file descriptor is still returned instead of -1. BSD
September 1, 1996 BSD
Man Page

4 More Discussions You Might Find Interesting

1. Solaris

rsh is not working ,error :connection refused

rsh is not working command:rsh targethost -l username command Error:Connection refused I checked on the server rshd was not working. Tried to start by /usr/sbin/in.rshd start # ./in.rshd start rshd: getpeername: Socket operation on non-socket Please help (1 Reply)
Discussion started by: aneita
1 Replies

2. Programming

rshd control string

My host environment is Linux and SCO systems talking to a remote SCO box. Authentication has been configured, I can do rcmd or rsh between the systems. I am trying to use rsh facility of remote unix box and I don't want to use system call to rsh or rcmd. Instead, I am trying to open 514 port... (3 Replies)
Discussion started by: migurus
3 Replies

3. AIX

Help with rsh problem

Hi all, just after a bit of help.. I am attempting to read in the contents of a flat text file from one system to another using 'rsh', i have this setup over around 15 machines and it works for them all except one. On this one machine it just reads in a blank line for some reason. The machine... (21 Replies)
Discussion started by: forefather1977
21 Replies

4. Shell Programming and Scripting

Can't rcmd with star name

We have had a script here for years used to send files to other computers or to rcmd a command entered thru a prompt. A file we are looking for on the other computers will start with the same characters followed by -nnnnnn.txt. I can log into another computer and find (or not) that file, but not... (4 Replies)
Discussion started by: wbport
4 Replies