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 47: Line 47:


=== Connecting to a server ===
=== Connecting to a server ===
You can connect to any server that is listed by the <code>selfListAccesses</code> command.
You can connect directly to any server that is listed by the <code>selfListAccesses</code> command.


Taking the example output from the previous section:<syntaxhighlight lang="bash">
Taking the example output from the previous section:<syntaxhighlight lang="bash">
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">
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>
</syntaxhighlight>
</syntaxhighlight>


28

edits

Navigation menu