DEV Community

ArcCosine
ArcCosine

Posted on

4 2

Multistage SSH's configuration.

Multistage ssh

In some circumstances, it was necessary to use multistage SSH.
(It is bad that "ssh port 22 Operation timed out" comes out almost on AWS.)

Preparation

  • Create server1's private key.
  • Create server2's private key.

Update config

Edit ssh config file.

vim ~/.ssh/config
Enter fullscreen mode Exit fullscreen mode

Add the following parameters.

Host preserver
  HostName server2.com
  ForwardAgent yes
  User server2user-name 
  IdentityFile ~/.ssh/server2key
  ProxyCommand ssh -l server1user-name -i ~/.ssh/server1key -p port-number server1.com -W %h:%p
Enter fullscreen mode Exit fullscreen mode

Command

ssh-add ~/.ssh/server2key
ssh preserver
Enter fullscreen mode Exit fullscreen mode

Enjoy!

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️