SSH to a server via Bastion: Difference between revisions

m
 
(One intermediate revision by the same user not shown)
Line 66: Line 66:
bssh <SERVER 2 USER>@<SERVER 2 IP>
bssh <SERVER 2 USER>@<SERVER 2 IP>
</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 destination domain name, the VM name is used). <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 destination domain name, the VM name is used). <syntaxhighlight lang="bash">
bssh <SERVER 1 USER>@<SERVER 1 NAME>
bssh <SERVER 1 USER>@<SERVER 1 HOSTNAME>


</syntaxhighlight>
</syntaxhighlight>
Line 74: Line 74:
# Show a help message, including available commands.
# Show a help message, including available commands.
help
help
# Basic info
# Basic info about your account.
info
info
# List accessible servers.
# List accessible servers.
selfListAccess
selfListAccess
# Generate scp passthrough script
# Generate scp passthrough script.
scp
scp
</syntaxhighlight>
</syntaxhighlight>
Line 89: Line 89:
BASTION_CMD="ssh davidbr@bastion-candig "
BASTION_CMD="ssh davidbr@bastion-candig "
# Change to FQDN or IP address, if needed.
# Change to FQDN or IP address, if needed.
BASTION_CMD="ssh davidbr@bastion.candig.sd4h.ca " # Or @<IP ADDRESS>
BASTION_CMD="ssh davidbr@198.168.188.147 " # Or @<DOMAIN NAME>
</syntaxhighlight>The scp-via-bastion script may also be renamed (or aliased) and moved from $HOME to a directory within the user's $PATH (such as ~/.local/bin/).
</syntaxhighlight>The scp-via-bastion script may also be renamed (or aliased) and moved from $HOME to a directory within the user's $PATH (such as ~/.local/bin/).


=== Access types ===
=== Access types ===
The Bastion provides both Group and Personal access methodologies.  Which method you use depends on The Bastion configurations.  Your connections will work the same no matter which method is used, so from a user perspective, the distinction is moot.
The Bastion provides both Group and Personal access methodologies.  Which method you use depends on The Bastion configurations.  Your connections will work the same no matter which method is used, so from a user perspective, the distinction is moot.
28

edits