SSH Tunnel for restricted user w/ PuTTY and no shell

I found a solution (under a post here with no use of tags like nologin or noshell but rather a dead simple trick for windows users, but I made it work for me without a shell).

I created a batch script using the answer from this post that can run a default installation of PuTTY and setup a tunnel without executing commands that would cause the shell to disconnect:

Dead simple SSH tunnel for my Windows users

"C:\Program Files (x86)\PuTTY\plink.exe" -v -N -D localhost:8080 proxy@remote_host

Since this makes Windows users with PuTTY able to now access the tunnel, I can stick with using the account shell as /bin/false

Posted here for anyone who might be in a similar situation and to resolve the thread. If there are any other solutions, I'd love to hear them!

Now I just have to try to make this work with my SSH push-based two-factor system I'm implementing on all my systems, but that's something to work on after everything else is working.

-Jim


Just saw that PuTTY has the following option and it may be what you are looking for : Connection->SSH->Don't start a shell or command

If enabled, the connection is made, no more display on the console, but it is kept alive and the tunnel works fine. Hope it helps.