Skip to content

Instantly share code, notes, and snippets.

@zoras
Created January 23, 2013 08:43
Show Gist options
  • Save zoras/4603223 to your computer and use it in GitHub Desktop.
Save zoras/4603223 to your computer and use it in GitHub Desktop.
ssh snipets
deploy@li166-177:~$cd ~/.ssh/
deploy@li166-177:~/.ssh$ls -lh
deploy@li166-177:~/.ssh$ grep authorized_key /etc/ssh/sshd_config
#AuthorizedKeysFile %h/.ssh/authorized_keys
deploy@li166-177:~/.ssh$ vi authorized_keys
deploy@li166-177:~/.ssh$ ls -lh
deploy@li166-177:~/.ssh$ chmod 600 authorized_keys
deploy@li166-177:~/.ssh$ chmod 600 authorized_keys*
# ssh setup
cat ~/.ssh/id_rsa.pub | ssh deployer@someapp.com 'cat >> ~/.ssh/authorized_keys'
ssh-add # -K on Mac OS X
#count no of files
find . -type f | wc -l
#find text in file
find ./ -name '*' | xargs grep -ni 'text to find'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment