-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #945 from flatcar/krnowak/move-openssh
Move net-misc/openssh from overlay to portage-stable, configuration changes
- Loading branch information
Showing
25 changed files
with
161 additions
and
114 deletions.
There are no files selected for viewing
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 @@ | ||
- Started shipping default ssh client and ssh daemon configs in `/etc/ssh/ssh_config` and `/etc/ssh/sshd_config` which include config snippets in `/etc/ssh/ssh_config.d` and `/etc/ssh/sshd_config.d`, respectively. |
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 @@ | ||
- openssh ([9.4p1](https://www.openssh.com/releasenotes.html#9.4p1)) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 90b28746c0d8698a080eb7082e0e14054aee0a02 Mon Sep 17 00:00:00 2001 | ||
From dd1512513b407e23155f58400cacecac8576d6f9 Mon Sep 17 00:00:00 2001 | ||
From: Krzesimir Nowak <[email protected]> | ||
Date: Mon, 27 Feb 2023 15:59:21 +0100 | ||
Subject: [PATCH] flatcar changes | ||
|
@@ -7,12 +7,12 @@ Subject: [PATCH] flatcar changes | |
azurelinuxagent/common/osutil/coreos.py | 39 +----- | ||
azurelinuxagent/common/osutil/coreoscommon.py | 57 ++++++++ | ||
azurelinuxagent/common/osutil/factory.py | 3 + | ||
azurelinuxagent/common/osutil/flatcar.py | 41 ++++++ | ||
azurelinuxagent/common/osutil/flatcar.py | 60 +++++++++ | ||
config/flatcar/waagent.conf | 122 ++++++++++++++++++ | ||
init/flatcar/10-waagent-sysext.conf | 2 + | ||
init/flatcar/waagent.service | 30 +++++ | ||
setup.py | 20 ++- | ||
8 files changed, 272 insertions(+), 42 deletions(-) | ||
8 files changed, 291 insertions(+), 42 deletions(-) | ||
create mode 100644 azurelinuxagent/common/osutil/coreoscommon.py | ||
create mode 100644 azurelinuxagent/common/osutil/flatcar.py | ||
create mode 100644 config/flatcar/waagent.conf | ||
|
@@ -164,10 +164,10 @@ index b5ee0b09..9280c645 100644 | |
if distro_name in ("suse", "sle_hpc", "sles", "opensuse"): | ||
diff --git a/azurelinuxagent/common/osutil/flatcar.py b/azurelinuxagent/common/osutil/flatcar.py | ||
new file mode 100644 | ||
index 00000000..3d1bf535 | ||
index 00000000..bf739a8e | ||
--- /dev/null | ||
+++ b/azurelinuxagent/common/osutil/flatcar.py | ||
@@ -0,0 +1,41 @@ | ||
@@ -0,0 +1,60 @@ | ||
+# | ||
+# Copyright 2023 Microsoft Corporation | ||
+# | ||
|
@@ -187,28 +187,47 @@ index 00000000..3d1bf535 | |
+# | ||
+ | ||
+import os | ||
+import os.path | ||
+import shutil | ||
+import stat | ||
+ | ||
+import azurelinuxagent.common.conf as conf | ||
+import azurelinuxagent.common.logger as logger | ||
+import azurelinuxagent.common.utils.fileutil as fileutil | ||
+ | ||
+from azurelinuxagent.common.osutil.coreoscommon import CoreosCommonUtil | ||
+ | ||
+ | ||
+class FlatcarUtil(CoreosCommonUtil): | ||
+ | ||
+ @staticmethod | ||
+ def get_systemd_unit_file_install_path(): | ||
+ return "/usr/lib/systemd/system" | ||
+ | ||
+ def conf_sshd(self, disable_password): | ||
+ # make sure that the config file stops being a symlink | ||
+ conf_file_path = conf.get_sshd_conf_file_path() | ||
+ conf_file_path2 = f"{conf_file_path}.wal.tmp" | ||
+ shutil.copy(conf_file_path, conf_file_path2) | ||
+ os.remove(conf_file_path) | ||
+ os.rename(conf_file_path2, conf_file_path) | ||
+ super(CoreosCommonUtil, self).conf_sshd(disable_password) | ||
+ pass | ||
+ ssh_dir = conf.get_ssh_dir() | ||
+ snippet_dir = os.path.join(ssh_dir, "sshd_config.d") | ||
+ statinfo = os.lstat(snippet_dir) | ||
+ if stat.S_ISDIR(statinfo.st_mode): | ||
+ # This adds a configuration snippet that will be loaded by | ||
+ # openssh. | ||
+ snippet_file = os.path.join(snippet_dir, "80-flatcar-walinuxagent.conf") | ||
+ option = "no" if disable_password else "yes" | ||
+ lines = [ | ||
+ f"PasswordAuthentication {option}", | ||
+ f"ChallengeResponseAuthentication {option}", | ||
+ f"ClientAliveInterval {str(conf.get_ssh_client_alive_interval())}" | ||
+ ] | ||
+ fileutil.write_file(snippet_file, "\n".join(lines)) | ||
+ logger.info("Added a configuration snippet {0} SSH password-based authentication methods. It also configures SSH client probing to keep connections alive." | ||
+ .format("disabling" if disable_password else "enabling")) | ||
+ else: | ||
+ # Make sure that the config file stops being a symlink. | ||
+ conf_file_path = conf.get_sshd_conf_file_path() | ||
+ conf_file_path2 = f"{conf_file_path}.wal.tmp" | ||
+ shutil.copy(conf_file_path, conf_file_path2) | ||
+ os.remove(conf_file_path) | ||
+ os.rename(conf_file_path2, conf_file_path) | ||
+ super(CoreosCommonUtil, self).conf_sshd(disable_password) | ||
diff --git a/config/flatcar/waagent.conf b/config/flatcar/waagent.conf | ||
new file mode 100644 | ||
index 00000000..b453c634 | ||
|
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/README
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
1 change: 1 addition & 0 deletions
1
...container/src/third_party/coreos-overlay/coreos-base/misc-files/files/50-flatcar-ssh.conf
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 @@ | ||
# Use defaults for ssh client system-wide configuration. |
26 changes: 26 additions & 0 deletions
26
...ontainer/src/third_party/coreos-overlay/coreos-base/misc-files/files/50-flatcar-sshd.conf
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,26 @@ | ||
# Use most defaults for sshd configuration. | ||
Subsystem sftp internal-sftp | ||
ClientAliveInterval 180 | ||
|
||
# These are either defaults or already set up by config generated by | ||
# the Gentoo ebuild. But we need to keep them, as the older | ||
# installations may still use the old symlink from | ||
# /etc/ssh/sshd_config to /usr/share/ssh/sshd_config. | ||
# | ||
# BEGIN SETTINGS KEPT FOR COMPATIBILITY | ||
UseDNS no | ||
UsePAM yes | ||
# handled by PAM | ||
PrintLastLog no | ||
# handled by PAM | ||
PrintMotd no | ||
# END SETTINGS KEPT FOR COMPATIBILITY | ||
|
||
Ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] | ||
MACs [email protected],[email protected],hmac-sha2-256,hmac-sha2-512,[email protected],[email protected] | ||
KexAlgorithms curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256 | ||
|
||
# Temporarily accept ssh-rsa algorithm for openssh >= 8.8, | ||
# until most ssh clients could deprecate ssh-rsa. | ||
HostkeyAlgorithms +ssh-rsa | ||
PubkeyAcceptedAlgorithms +ssh-rsa |
2 changes: 2 additions & 0 deletions
2
...r/src/third_party/coreos-overlay/coreos-base/misc-files/files/no-trigger-limit-burst.conf
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,2 @@ | ||
[Socket] | ||
TriggerLimitBurst=0 |
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
File renamed without changes.
13 changes: 5 additions & 8 deletions
13
sdk_container/src/third_party/coreos-overlay/coreos/config/env/net-misc/openssh
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
4 changes: 2 additions & 2 deletions
4
sdk_container/src/third_party/coreos-overlay/net-misc/openssh/Manifest
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DIST openssh-9.3p2.tar.gz 1835850 BLAKE2B 38f8d4ada263112b318fafccabf0a33a004d8290a867434004eb3d37127c9bdabe6e0225fca9d6d68fb54338fec81dcc9313ca7c91d3a033311db44174dc9f6f SHA512 15b8c57aa120186f1d1c3c2b8dc6ffd26733e12f755a6b0a4255d9ec1815a61506275ff5723b4ac029e44bc2ad22852ac36e1101f292348fbfa79aa1a4cd3f35 | ||
DIST openssh-9.3p2.tar.gz.asc 833 BLAKE2B cfba3867d7f97cb2c904bd3ae111bd63e8a050464b66e3f3f22390839a153d57ef5819182f8ad99a6b520f27881143552dc64fccfc33dcc0483ffe1ef33a5a47 SHA512 759e512a36a3a62264803b517298a65c83e1daebd9867e28ea1ca4999c38539368815ccda86540a4f5d45fa79c539d8242995ba55f2918baf2a7404c105e337a | ||
DIST openssh-9.4p1.tar.gz 1845094 BLAKE2B d13d758129cce947d3f12edb6e88406aad10de6887b19ffa3ebd8e382b742a05f2a692a8824aec99939f6c7e13fbccc3bb14e5ee112f9a9255d4882eb87dcf53 SHA512 0aaedeced7dbc70419c7245eb0e9db4ef570e0e7739b890ebae04d56da5fe8d147e8e150f3c943f60730976569e3ac6cc8da62ec7e2a78e2ef47d295ca0b1d25 | ||
DIST openssh-9.4p1.tar.gz.asc 833 BLAKE2B 95eedd9356766e5d0ea1261da3dc4c7869f054b418c626fb35815a0aa655b1ddbf54436b437d98c4344b05c9196c8fa1f592eac07b3ccf08bd3e980f8b6955af SHA512 983b4ebaa3b98e70831ce686cb503270926c065163a2510eef0c5102ef50b6e665b889ee15ea8c0bd7c4bbddb19270f036e1d554a8212ef2c292f9c682c8631a |
11 changes: 0 additions & 11 deletions
11
...rd_party/coreos-overlay/net-misc/openssh/files/openssh-9.3_p1-gss-use-HOST_NAME_MAX.patch
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
...y/coreos-overlay/net-misc/openssh/files/openssh-9.3_p1-openssl-version-compat-check.patch
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...ainer/src/third_party/coreos-overlay/net-misc/openssh/files/openssh-9.3_p2-zlib-1.3.patch
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,21 @@ | ||
https://bugs.gentoo.org/912766 | ||
https://github.com/openssh/openssh-portable/commit/cb4ed12ffc332d1f72d054ed92655b5f1c38f621 | ||
|
||
From cb4ed12ffc332d1f72d054ed92655b5f1c38f621 Mon Sep 17 00:00:00 2001 | ||
From: Darren Tucker <[email protected]> | ||
Date: Sat, 19 Aug 2023 07:39:08 +1000 | ||
Subject: [PATCH] Fix zlib version check for 1.3 and future version. | ||
|
||
bz#3604. | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -1464,7 +1464,7 @@ else | ||
[[ | ||
int a=0, b=0, c=0, d=0, n, v; | ||
n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); | ||
- if (n != 3 && n != 4) | ||
+ if (n < 1) | ||
exit(1); | ||
v = a*1000000 + b*10000 + c*100 + d; | ||
fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ Conflicts=sshd.service | |
[Socket] | ||
ListenStream=22 | ||
Accept=yes | ||
TriggerLimitBurst=0 | ||
|
||
[Install] | ||
WantedBy=sockets.target |
Oops, something went wrong.