Re: SSH Port forwarding



On 2007-01-18, Jc <ramschitra@xxxxxxxxx> wrote:
I don't want the user to login into my host instead I want the user to
connect only the specific port. But what happens is, if I execute the
port forwarding command, the user was able to login to my host.
Hoe is can be avided.

If you're using OpenSSH you can set the user's shell to, eg, /bin/true.
(You will probably have to add /bin/true to /etc/shells too). The user
will need to specify -N (or its equivalent in their client) to prevent
the client from requesting a shell. This will work only with the SSHv2
protocol.

Another alternative is to make the user's shell to be a shell script
that does something like "exec sleep 300". This will work with both
versions of the ssh protocol but will leave a bunch of sleep processes
running for a while.

As far as restricting the users to a specific port, older versions of
OpenSSH could only do that if you were using pubkey authentication.
Newer versions (>=4.4) have a PermitOpen directive for this purpose.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
.



Relevant Pages

  • ANNOUNCE: DJGPP port of GNU Make 3.81 uploaded
    ... This is a port of GNU Make 3.81 to MSDOS/DJGPP. ... The are two kind of required djgpp specific changes to the sources: ... of the SHELL Makefile variable is no longer exported automatically. ...
    (comp.os.msdos.djgpp)
  • RE: Port 4662 exploitation
    ... shell, but to get a tcp header and know what services might be running ... arbitrary port is clearly a most valuable find. ... Stay Ahead of the Hacker Curve! ... Security Trends Report from Cenzic ...
    (Pen-Test)
  • Re: Application starting from boot-up
    ... When the application is started manually, this message appears on the Shell ... port, which is the main serial port on the board. ... want to copy in an update (using the cp command from a flash memory stick), ... the usual recommended way to develop an application for a system that has Linux ...
    (comp.os.linux.embedded)
  • Re: Application starting from boot-up
    ... starting it up from the Shell port. ... port, which is the main serial port on the board. ... is started from /etc/init.d/rcS script, then this message does not appear. ... a system that has Linux pre-installed and where I do not want to make any ...
    (comp.os.linux.embedded)
  • RE: command-line reverse connection tunnel?
    ... port redirection. ... E.G. for a shell you can: ... Revinetd is used for port redirection ... >What exactly is different from using netcat listeners on both, ...
    (Pen-Test)