Skip to content

Instantly share code, notes, and snippets.

@guileen
Created April 12, 2012 09:13
Show Gist options
  • Save guileen/2365771 to your computer and use it in GitHub Desktop.
Save guileen/2365771 to your computer and use it in GitHub Desktop.
create user for ssh no shell
# ensure you have nologin
#
# less /etc/shells
# which nologin
# /usr/sbin/nologin
# echo `which nologin` >> /etc/shells
useradd -m -s /usr/sbin/nologin public
# login without password
# http://www.linuxproblem.org/art_9.html
# ssh-keygen -t rsa
# cat .ssh/id_rsa.pub | ssh public@host 'cat >> .ssh/authorized_keys'
# ssh -CD 8888 -N public@host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment