Skip to content

Commit

Permalink
profiles: restore entries for ssh-related paths
Browse files Browse the repository at this point in the history
This partially reverts commit d94f547 ("disable all ssh utilities in
disable-common.inc", 2023-08-20).

Certain files in ~/.ssh are only used by sshd (not by ssh), so always
blacklist them.

Also, ssh itself does not need write access to the configuration files,
so make them read-only by default.

For details, see commit 2ec3f3a ("disable-common.inc: add missing
openssh paths", 2021-01-09) / PR #3885.

Cc: @netblue30
  • Loading branch information
kmk3 committed Aug 21, 2023
1 parent 75cefd5 commit 5ba5ed0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion etc/inc/disable-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ read-only ${HOME}/.zshenv
read-only ${HOME}/.zshrc
read-only ${HOME}/.zshrc.local

# Remote access - ${HOME}/.ssh directory blacklisted in top secret section below
# Remote access (used only by sshd; should always be blacklisted)
blacklist ${HOME}/.rhosts
blacklist ${HOME}/.shosts
blacklist ${HOME}/.ssh/authorized_keys
blacklist ${HOME}/.ssh/authorized_keys2
blacklist ${HOME}/.ssh/environment
blacklist ${HOME}/.ssh/rc
blacklist /etc/hosts.equiv

# Initialization files that allow arbitrary command execution
Expand Down Expand Up @@ -354,6 +358,8 @@ read-only ${HOME}/.nanorc
read-only ${HOME}/.npmrc
read-only ${HOME}/.pythonrc.py
read-only ${HOME}/.reportbugrc
read-only ${HOME}/.ssh/config
read-only ${HOME}/.ssh/config.d
read-only ${HOME}/.tmux.conf
read-only ${HOME}/.vim
read-only ${HOME}/.viminfo
Expand Down

0 comments on commit 5ba5ed0

Please sign in to comment.