Socket problem, please help
brnstnd at stealth.acf.nyu.edu
brnstnd at stealth.acf.nyu.edu
Sun Apr 15 07:50:12 AEST 1990
In article <2812 at milton.acs.washington.edu> eliot at dodongo.engr.washington.edu (Eliot Lim) writes:
> The program is a file server/client using sockets for transfer.
> The client program prompts the user for a filename, sends it through
> the socket to the server, the server reads the file and sends it back
> through the socket.
auth to the rescue...
foo: #!/bin/sh
# Look Ma, no passwords!
(date; echo "$PROTO:$REMOTE") >> fileserver.log
# security: only allow requests if authenticated and from right source
if [ x"$PROTO:$REMOTE" = xTCP:eliot at 128.19.95.8 ]
then cat < "`head -1`" # might want to strip out slashes with | tr -d /
fi
server% attachport -X -p50505 ./foo &
dodongo% authtcp -R server 50505 sh -c 'echo -n Filename:" ";head -1>&6;cat<&6'
The -X on attachport means that the user on the server side isn't
authenticated; the -R on authtcp means not to look for the server's
authentication. For more security in case 50505 might not be free,
-p50505 should be replaced by -1, the port chosen by the system should
be communicated in some other way, and -R/-X should disappear in favor
of client REMOTE tests.
---Dan
More information about the Comp.unix.wizards
mailing list