-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It outputs the host, port and user information for later plugin into terraform's connection map. It can't take advantage of Triton's CNS because of issue hashicorp/terraform#2143. It will not "converge" because the system fails to detect the firewall_enabled flag from Triton's CloudAPI, issue hashicorp/terraform#6109. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # deleted: bastion/bastion-user-script.sh # modified: bastion/main.tf # new file: bastion/ssh.config.in # new file: bastion/user-script.sh #
- Loading branch information
Showing
4 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Loosely based on https://medium.com/@paulskarseth/ansible-bastion-host-proxycommand-e6946c945d30#.gdb1u6bjg | ||
UserKnownHostsFile=/dev/null | ||
StrictHostKeyChecking=no | ||
|
||
Host bastion | ||
User admin | ||
HostName BASTION_IP | ||
IdentityFile ~/.ssh/id_rsa | ||
BatchMode yes | ||
PasswordAuthentication no | ||
|
||
Host * | ||
ServerAliveInterval 60 | ||
TCPKeepAlive yes | ||
ProxyCommand ssh -W %h:%p -A admin@BASTION_IP | ||
ControlMaster auto | ||
ControlPath ~/.ssh/mux-%r@%h:%p | ||
ControlPersist 8h | ||
IdentityFile ~/.ssh/id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Disable the admin's shell | ||
usermod -s /bin/false admin | ||
|
||
# Disable SFTP | ||
sed -E -i .bck \ | ||
-e "s/^Subsystem(.*)/#Subsystem\1/" \ | ||
/etc/ssh/sshd_config | ||
|
||
# Disable root login in prod | ||
environment = $(mdata-get env) | ||
if [ "$environment" == "prod" ]; then | ||
sed -E -i .bck \ | ||
-e "s/PermitRootLogin.*/PermitRootLogin no/" \ | ||
/etc/ssh/sshd_config | ||
else | ||
sed -E -i .bck \ | ||
-e "s/PermitRootLogin.*/PermitRootLogin without-password/" \ | ||
/etc/ssh/sshd_config | ||
fi | ||
|
||
svcadm refresh ssh |