Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:02:41+00:00 2026-05-26T07:02:41+00:00

Here is what I want to do : SSH to server 1 inside server

  • 0

Here is what I want to do :

  1. SSH to server 1
  2. inside server 1, SSH to server 2
  3. inside server 2, SSH to server 3
  4. inside server 3, run a single command ( like mysql )
  5. inside mysql console, run another command.
  6. then exit all the way to server 1

Is it possible to do a procedure like this ? If yes, then how ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:02:42+00:00Added an answer on May 26, 2026 at 7:02 am

    It is possible: Just execute ssh (or a corresponding Python program you upload first) on each new hop, and when you finally reach the target, execute mysql.

    However, it’s not advisable: You should never enter passwords (or worse, store private keys) for one server on another server. That means that if server 1 is ever compromised, your whole network is compromised.

    Instead, use the first two ssh sessions to create tunnels to the next hop, either with the -L option of the command-line ssh (which you probably need to use anyways, see above), or with paramiko.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to run a command from my machine using ssh
Here's what I want the resulting class declaration to look like: public sealed partial
I want to clone a new project with a command like git clone git@some_link.com:some_word/project_name.git
I've opened a ssh tunnel with ssh -D localhost:5678 me@server.com and I want to
I want to write code in Ruby witch net::ssh that run commands one by
I'm not entirely sure if I can do what I want here, but I
I've managed to find the Regex to get almost the result I want here
I know, I am propably way out of line here :-) I want to
I work for a travel agency, they have a website, from here they want
I am having problems here if I want to check if eerste points to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.