Created
October 31, 2010 01:27
-
-
Save jgoulah/655984 to your computer and use it in GitHub Desktop.
new server ssh setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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