Skip to content

Instantly share code, notes, and snippets.

@quentinsf
quentinsf / sshput
Created May 18, 2012 11:12
sshput - copy an ssh id into the authorized keys on a remote machine
#!/bin/sh
# sshput <remotehost>
#
# Puts your local DSA public key into the .ssh/authorized_keys
# on a remote machine. This should allow you to login without
# needing a password.
#
# This software comes with no guarantees whatsoever, and is yours to
# do with as you will. I'd be grateful if you feed any generally-useful
# improvements back to me, for the benefit of others.
@nfreader
nfreader / sshput-function.sh
Created October 31, 2011 18:55 — forked from jfro/sshput-function.sh
modified someone's sshput command for uploading ssh public keys
sshput () {
RSAKEY="${HOME}/.ssh/id_rsa.pub"
DSAKEY="${HOME}/.ssh/id_dsa.pub"
if [ $# -eq 2 ]; then
KEY=$1
if [ ! -r $KEY ]
then
echo "'$KEY' does not exist or is not readable"
return 1