GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RCMDSH(3) FreeBSD Library Functions Manual RCMDSH(3)

rcmdsh
return a stream to a remote command without superuser

#include <unistd.h>

int
rcmdsh(char **ahost, int inport, const char *locuser, const char *remuser, const char *cmd, const char *rshprog);

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.

The rcmdsh() function returns a valid socket descriptor on success. Otherwise, -1 is returned and a diagnostic message is printed on the standard error.

rsh(1), socketpair(2), rcmd(3), rshd(8)

The rcmdsh() function first appeared in OpenBSD 2.0, and made its way into FreeBSD 4.6.

If rsh(1) encounters an error, a file descriptor is still returned instead of -1.
September 1, 1996 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.