ssh proxy

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a setup like this:

         ,- ServerA
 Router --- ServerB
         '- ServerC

I create users on routers, and they ssh to router, then to Servers.
I don't want that they keep access to router, so I wrote a little
script which make basically a:
 (function to propose to choose between servers) and
case $choice in
    ssh user@servera
    ssh user@serverb
    ssh user@serverc

If I put that in login shell, it works well. But, I want to put this script  
in a Forcecommand directive.
So my /etc/ssh/sshd_config contains a match block:
Match User user
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand /usr/bin/

If I keep the script, it doesn't work because no tty is allocated:

 stdin: is not a tty

I can force the allocation of tty by changing the lines:
ssh user@servera
ssh -tt user@servera

but the output is not very nice, every line is doubled:
root@router:~#      (I press return)


root@router:~# ls

So, how can I force command to my chooser and having tty allocated?


Re: ssh proxy

On Saturday, July 20, 2013 at 12:37:01 AM UTC+10, Kevin Denis wrote:
Quoted text here. Click to load it

Kevin, you might need to set the TERM variable, so that the console driver can output the correct escape sequences for the terminal emulator being used.

Site Timeline