Skip to content

Instantly share code, notes, and snippets.

@CarlOlson
Created December 15, 2017 05:39
Show Gist options
  • Save CarlOlson/4dde90c9d415c5a0d3bd964fab3e7f00 to your computer and use it in GitHub Desktop.
Save CarlOlson/4dde90c9d415c5a0d3bd964fab3e7f00 to your computer and use it in GitHub Desktop.
mkdir -p notrust/.ssh
touch notrust/.ssh/authorized_users
useradd -d notrust notrust
chown -R notrust:notrust notrust
chown root:root notrust
chmod 700 notrust/.ssh
chmod 644 notrust/.ssh/authorized_users
echo 'AllowUsers ... notrust' > /etc/ssh/sshd_config
echo 'command="echo hello",restrict ssh-rsa ...' > notrust/.ssh/authorized_users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment