We've confirmed that these steps work on a brand new installation of macOS Sierra or a brand new installation of macOS Sierra with Pivotal's workstation-setup
./README.macOS.bash
ssh <hostname of your machine> # e.g., ssh briarwood
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts
System Preferences -> Sharing -> Remote Login
mkdir -p ~/.ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
mkdir -p "$HOME/.ssh"
cat >> ~/.bash_profile << EOF
# Allow ssh to use the version of python in path, not the system python
# BEGIN SSH agent
# from http://stackoverflow.com/questions/18880024/start-ssh-agent-on-login/18915067#18915067
SSH_ENV="\$HOME/.ssh/environment"
# Refresh the PATH per new session
sed -i .bak '/^PATH/d' \${SSH_ENV}
echo "PATH=\$PATH" >> \${SSH_ENV}
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "\${SSH_ENV}"
echo succeeded
chmod 600 "\${SSH_ENV}"
source "\${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "\${SSH_ENV}" ]; then
. "\${SSH_ENV}" > /dev/null
ps -ef | grep \${SSH_AGENT_PID} 2>/dev/null | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
[ -f ~/.bashrc ] && source ~/.bashrc
# END SSH agent
EOF
sudo tee -a /etc/ssh/sshd_config << EOF
# Allow ssh to use the version of python in path, not the system python
PermitUserEnvironment yes
EOF