Question: I need to reach server-C through server-A and server-B. Any shortcut?
Try: ssh -J linuxteck@bastion,linuxteck@jumphost linuxteck@internal-server
Info: -J (Jump host) chains multiple SSH connections sequentially: local → bastion → jumphost → target. This lets you reach an internal server through multiple intermediate SSH hosts without manually opening nested SSH sessions.
Examples:
- $
ssh -J user@bastion user@internal# Single jump host - $
scp -J user@bastion file.iso user@internal:/tmp/# Copy files via jump host - $
rsync -e 'ssh -J user@bastion' -av /src/ user@internal:/dst/# Sync over jump host
Note: -J is the command-line equivalent of ProxyJump in ~/.ssh/config. It is cleaner than nested ssh -t sessions and avoids the need for SSH agent forwarding in many jump-host setups. Make sure your SSH keys and access permissions are configured for the required hosts.
Leave a Reply