SSH to a server via Bastion: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 55: Line 55:
# connect to "SERVER 2"
# connect to "SERVER 2"
bssh <SERVER 2 USER>@<SERVER 2 IP>
bssh <SERVER 2 USER>@<SERVER 2 IP>
</syntaxhighlight>You may avoid using IP addresses by creating a host name in your ~/.ssh/config such as:<syntaxhighlight lang="bash">
</syntaxhighlight>OpenStack provides name resolution for VMs on the same network. If the bastion server is on the same OpenStack network as the destination servers, you may use the VM name rather than its IP address. This makes using bssh essentially identical to using ssh (though rather than a domain name, the VM name is used). <syntaxhighlight lang="bash">
Host <SERVER 1 NAME>
    HostName <SERVER 1 IP>
</syntaxhighlight>This allows you to connect through bastion directly to any server with:<syntaxhighlight lang="bash">
# Connect to a server, using the ~/.ssh/config host name.
# This makes using bssh essentially identical to using ssh.  
bssh <SERVER 1 USER>@<SERVER 1 NAME>
bssh <SERVER 1 USER>@<SERVER 1 NAME>
</syntaxhighlight>
</syntaxhighlight>


28

edits

Navigation menu