Skip to content

Instantly share code, notes, and snippets.

@jgoulah
Created October 31, 2010 01:27
Show Gist options
  • Select an option

  • Save jgoulah/655984 to your computer and use it in GitHub Desktop.

Select an option

Save jgoulah/655984 to your computer and use it in GitHub Desktop.
new server ssh setup
#!/bin/sh
# creates a .ssh/config entry, makes an ssh-to link
# scp's over .ssh dir
run_args="$0 <server>";
server=$1
if [ -z $server ]; then
echo $run_args;
exit
fi
echo "creating config..."
echo "" >> .ssh/config
echo "host $1" >> .ssh/config
echo " hostname $1" >> .ssh/config
echo " user jgoulah" >> .ssh/config
echo " ProxyCommand ssh work exec nc %h %p" >> .ssh/config
echo "creating ssh-to link..."
ln -s ~/bin/ssh-to ~/bin/$server
echo "scp'ing over .ssh dir (requires pass) ..."
scp -r .ssh $server:
#!/bin/bash
hostname=`basename $0`
# set hostname
echo -n -e "\033k${hostname%%.*}\033\134"
ssh -X $hostname $*
# set hostname back when session is done (-s on osx)
echo -n -e "\033k`hostname -s`\033\134"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment