Skip to content

Add test case which shows how proxycommand works. #51

@starnowski

Description

@starnowski

https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/

Create three test cases:
1)
ssh -tt vivek@Jumphost ssh -tt vivek@FooServer command1 arg1 arg2

Passing second "ssh" command

ssh -o ProxyCommand='ssh firewall nc remote_server1 22' remote_server1

Using "ProxyCommand" option in ssh

Use ~/.ssh/config file:

Example:

Host fooserver
HostName FooServer
User vivek
ProxyCommand ssh vivek@Jumphost nc %h %p

Host fooserver : Set nickname of your choice.
HostName FooServer : Set the real remote server/host name.
User vivek : Set the real user name for remote server/host.
ProxyCommand ssh vivek@Jumphost nc %h %p : Specifies the command to use to connect to the server. In this example, I’m using nc command. Any occurrence of %h will be substituted by the host name to connect, %p by the port, and %r by the remote user name.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions