Sample Header Ad - 728x90

SSH jump proxy to access RSH-only endpoint

0 votes
0 answers
285 views
The setup: only a single server in the group is acessible via SSH. Others are accessible from the former via RSH only. So when I want to execut a command on other servers, I do this:
$ ssh asd10 rsh asd7 hostname
ASD7
Is it possible to combine this into ProxyCommand in the classical SSH jumphost way? > A configuration like this will allow you to proxy through HOST A. > >
> $ cat .ssh/config
> 
> Host host-a
>   User your_username
>   Hostname 10.0.0.5
> 
> Host host_b
>   User your_username
>   Hostname 192.168.0.1
>   Port 22  
>   ProxyCommand ssh -q -W %h:%p host-a
>
> > Now if you want to connect to your HOST B, all you have to type is ssh host_b ... so I could run:
$ ssh asd7 hostname
ASD7
? **[Supplemented]** If I go straightly like @cas asked:
$ ssh -t -o ProxyCommand='ssh asd10 rsh %h' asd7 hostname
tcgetattr: Invalid argument
ioctl TIOCGETP: Invalid argument
ioctl TIOCLGET: Invalid argument
ioctl TIOCGETC: Invalid argument
ioctl TIOCGLTC: Invalid argument
ioctl TIOCGETP: Invalid argument
ioctl TIOCLGET: Invalid argument
ioctl TIOCSLTC: Invalid argument
ioctl TIOCSETC: Invalid argument
ioctl TIOCSETN 3: Invalid argument
ioctl TIOCLSET: Invalid argument
Killed by signal 2.
... it stays in a loop until I press Ctrl-C. It probably waits for the input and then generates no output. I haven't used a working shell session in parallel to check if the former actually spawns any new processes.
Asked by saulius2 (151 rep)
Oct 28, 2019, 08:35 AM
Last activity: May 8, 2023, 10:37 AM