Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/bugfixes/2026-10-26-ssh-perms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Alpha and Beta only: Fixed SSH client that was broken by a configuration file with bad permissions being unreadable. ([scripts#4338](https://github.com/flatcar/scripts/pull/4338))
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cros_post_src_install_flatcar_modifications() {
vendorize_pam_files

if [[ $(flatcar_target) != 'sdk' ]] ; then
insopts -m 0644
dosym -r /usr/share/flatcar/etc/ssh/ssh_config.d/50-flatcar-ssh.conf /usr/share/ssh/ssh_config
insinto /usr/share/flatcar/etc/ssh/ssh_config.d/
newins - 50-flatcar-ssh.conf
Expand All @@ -18,6 +19,7 @@ cros_post_src_install_flatcar_modifications() {
# Use defaults for ssh client system-wide configuration.
EOF

insopts -m 0600
dosym -r /usr/share/flatcar/etc/ssh/sshd_config.d/50-flatcar-sshd.conf /usr/share/ssh/sshd_config
insinto /usr/share/flatcar/etc/ssh/sshd_config.d/
newins - 50-flatcar-sshd.conf
Expand Down Expand Up @@ -46,18 +48,16 @@ PrintMotd no
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
EOF

# Install our socket drop-in file that disables the rate
# limiting on the sshd socket.
(
insopts -m 0644
unit_dir=$(systemd_get_systemunitdir)
insinto "${unit_dir}/sshd.socket.d"
newins - no-trigger-limit-burst.conf <<'EOF'
insopts -m 0644
insinto "$(systemd_get_systemunitdir)/sshd.socket.d"
newins - no-trigger-limit-burst.conf <<'EOF'
[Socket]
TriggerLimitBurst=0
EOF
# Enable some sockets that aren't enabled by their own ebuilds.
systemd_enable_service sockets.target sshd.socket
)
# Enable some sockets that aren't enabled by their own ebuilds.
systemd_enable_service sockets.target sshd.socket
fi
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ cros_stack_hooks() {
einfo "Running stacked hooks for ${phase}"
header=false
fi

# Don't allow *into or *opts helper values to leak between ebuilds and
# hook functions. They normally leak between ebuild phases, but leaking
# them to and from other scripts maintained by other people is
# hazardous. These default values come from Portage's phase-helpers.sh.
local -x __E_DESTTREE="/usr" __E_INSDESTTREE= __E_EXEDESTTREE= __E_DOCDESTTREE=
local -x INSOPTIONS="-m0644" EXEOPTIONS="-m0755" LIBOPTIONS="-m0644" DIROPTIONS="-m0755"

ebegin " ${func#cros_${phase}_}"
${func}
eend $?
Expand Down
Loading