> From: Susan Chan Lee [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 28, 2002 12:05 PM
>   
> Does anyone know how to set-up a secure remote connection using
> netcat, in that one which uses authenication or port filtering
> (without the need to install any other wrapper software). 
>   
> I have a requirement were I need to connect to a remote machine and
> get a command prompt. We all know how to do this via netcat by
> setting up a listening port. My concern is that I do not want to
> leave the port open for anyone to connect.
>   
> It would be great if when someone connects authenication is required,
> hence in effect all I need is to connect to a remote machine, get
> prompted for a password and then get a command prompt, if netcat
> cannot do this, does anyone know any other peice of software (not
> NetBIOS or SMB)?

With netcat you can do whatever you want, but that's not a good
thought IMHO. Use ssh instead. But this little idea came to mind,
works with ba(sh) (use cygwin on Win)

  #! /bin/bash

  LOGIN=buffalo
  PASSWORD=bill

  while :
  do
          echo -n "login: "
          read login
          echo -n "password: "
          read password
          if [ $login = $LOGIN ] && [ $password = $PASSWORD ]
          then
                  /bin/bash -i
          else
                  sleep 5
          fi
  done

$ while :; do nc -l -p 2000 -e script.sh; done

HTH,
-Roberto

Reply via email to