Last active
October 13, 2016 15:59
-
-
Save smj10j/621adbac7a8069a519218ec193d1b948 to your computer and use it in GitHub Desktop.
Fix Sandbox Child Path on OSX for OpenSSH's sshd 7.3p1
This file contains hidden or 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
#!/bin/bash | |
# | |
# Patch for error message: | |
# ssh_sandbox_child: sandbox_init: @PREFIX@/share/openssh/org.openssh.sshd.sb: profile not found [preauth] | |
# | |
# Fix based on https://github.com/Homebrew/homebrew-dupes/issues/641 | |
# | |
set -e | |
#set -x | |
OPENSSH_DIR=$(brew --cellar openssh)'/7.3p1' | |
rm -f /usr/local/Cellar/openssh/7.3p1/sbin/sshd.patched | |
bspatch "${OPENSSH_DIR}/sbin/sshd" "${OPENSSH_DIR}/sbin/sshd.patched" "osx-openssh-7.3p1-sandbox-dir.patch" | |
chmod +x-w "${OPENSSH_DIR}/sbin/sshd.patched" | |
rm -f "$(brew --prefix)/sbin/sshd" | |
ln -s "${OPENSSH_DIR}/sbin/sshd.patched" "$(brew --prefix)/sbin/sshd" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fix is not working for me. The patched sshd just dies:
Wouldn't it be easier to just change
@PREFIX@/share/openssh/org.openssh.sshd.sb
to/System/Library/Sandbox/Profiles/org.openssh.sshd.sb
in the source code?