mirror of
/repos/baseimage-docker.git
synced 2026-02-27 17:41:59 +01:00
Merge branch 'feature/16' of https://github.com/thomasleveil/baseimage-docker into thomasleveil-feature/16
This commit is contained in:
@@ -12,6 +12,19 @@ else
|
||||
chmod 700 "$DIR"
|
||||
chown root:root "$DIR"
|
||||
echo "Editing $AUTHORIZED_KEYS..."
|
||||
cat /etc/insecure_key.pub > "$AUTHORIZED_KEYS"
|
||||
cat /etc/insecure_key.pub >> "$AUTHORIZED_KEYS"
|
||||
echo "Success: insecure key has been added to $AUTHORIZED_KEYS"
|
||||
cat <<-EOF
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| Insecure SSH key installed |
|
||||
| |
|
||||
| DO NOT expose port 22 on the Internet unless you know what you are doing! |
|
||||
| |
|
||||
| Use the private key bellow to connect with user root |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
EOF
|
||||
cat /etc/insecure_key
|
||||
echo -e "\n\n"
|
||||
fi
|
||||
|
||||
@@ -167,7 +167,14 @@ def wait_for_runit_services():
|
||||
if not done:
|
||||
time.sleep(0.1)
|
||||
|
||||
def install_insecure_key():
|
||||
info("Installing insecure SSH key for user root")
|
||||
run_command_killable("/usr/sbin/enable_insecure_key")
|
||||
|
||||
def main(args):
|
||||
if args.enable_insecure_key:
|
||||
install_insecure_key()
|
||||
|
||||
if not args.skip_startup_files:
|
||||
run_startup_files()
|
||||
|
||||
@@ -217,6 +224,9 @@ parser.add_argument('--no-kill-all-on-exit', dest = 'kill_all_on_exit',
|
||||
parser.add_argument('--quiet', dest = 'log_level',
|
||||
action = 'store_const', const = LOG_LEVEL_WARN, default = LOG_LEVEL_INFO,
|
||||
help = 'Only print warnings and errors')
|
||||
parser.add_argument('--enable-insecure-key', dest = 'enable_insecure_key',
|
||||
action = 'store_const', const = True, default = False,
|
||||
help = 'Install the insecure SSH key')
|
||||
args = parser.parse_args()
|
||||
log_level = args.log_level
|
||||
|
||||
|
||||
@@ -29,8 +29,9 @@ mkdir -p /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
chown root:root /root/.ssh
|
||||
cp /build/insecure_key.pub /etc/insecure_key.pub
|
||||
chmod 644 /etc/insecure_key.pub
|
||||
chown root:root /etc/insecure_key.pub
|
||||
cp /build/insecure_key /etc/insecure_key
|
||||
chmod 644 /etc/insecure_key*
|
||||
chown root:root /etc/insecure_key*
|
||||
cp /build/enable_insecure_key /usr/sbin/
|
||||
|
||||
## Install cron daemon.
|
||||
|
||||
Reference in New Issue
Block a user