- 
      
- 
        Save AliAryanTech/a54621e44df2062f4d99a31b8064d121 to your computer and use it in GitHub Desktop. 
Revisions
- 
        slowkow revised this gist Dec 15, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ Save yourself a few keystrokes. Follow the steps below: 2. If you would prefer to type `jupiter` (7 characters) rather than `[email protected]` (21 characters), create a config file `~/.ssh/config` on your laptop, as shown below. You'll be able to use the `jupiter` alias with: `rsync`, `scp`, and `ssh`. ``` 
- 
        slowkow revised this gist Dec 15, 2014 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -34,11 +34,12 @@ Save yourself a few keystrokes. Follow the steps below: 2. If you would prefer to type `jupiter` (7 characters) rather than `[email protected]` (21 characters), create a config file `~/.ssh/config` on your laptopt, as shown below. You'll be able to use the `jupiter` alias with: `rsync`, `scp`, and `ssh`. ``` # ~/.ssh/config Host jupiter User carl HostName myserver.com 
- 
        slowkow revised this gist Dec 15, 2014 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -33,17 +33,15 @@ Save yourself a few keystrokes. Follow the steps below: ``` 2. If you would prefer to type `jupiter` (7 characters) rather than `[email protected]` (21 characters), create a config file `~/.ssh/config` as shown below. You'll be able to use this alias with: `rsync`, `scp`, and `ssh`. ``` # ~/.ssh/config Host jupiter User carl HostName myserver.com ``` At this point, you can connect to your server like this: @@ -70,6 +68,12 @@ Save yourself a few keystrokes. Follow the steps below: User carl ProxyCommand ssh -qX jupiter nc %h %p ``` At this point, you can connect to `saturn` via `jupiter` like this: ```bash ssh saturn ``` # Further reading 
- 
        slowkow revised this gist Oct 18, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -46,6 +46,12 @@ Save yourself a few keystrokes. Follow the steps below: END ``` At this point, you can connect to your server like this: ```bash ssh jupiter ``` 3. If you want a single command to do two steps: 1. First, connect to a login server `jupiter` 
- 
        slowkow revised this gist Oct 18, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -32,9 +32,9 @@ Save yourself a few keystrokes. Follow the steps below: ssh [email protected] ``` 2. If you would prefer to type `jupiter` (7 characters) rather than `[email protected]` (21 characters), run this Bash script on your laptop. You'll be able to use this alias with: `rsync`, `scp`, and `ssh`. ```bash #!/usr/bin/env bash 
- 
        slowkow revised this gist Oct 13, 2014 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -46,8 +46,12 @@ Save yourself a few keystrokes. Follow the steps below: END ``` 3. If you want a single command to do two steps: 1. First, connect to a login server `jupiter` 2. Next, connect to a work server `saturn` Then configure your `~/.ssh/config` file as follows: ``` # ~/.ssh/config @@ -59,4 +63,14 @@ Save yourself a few keystrokes. Follow the steps below: Host saturn User carl ProxyCommand ssh -qX jupiter nc %h %p ``` # Further reading How to write your own config file: - http://www.cyberciti.biz/faq/create-ssh-config-file-on-linux-unix/ All available configuration options: - http://linux.die.net/man/5/ssh_config 
- 
        slowkow revised this gist Oct 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Save yourself a few keystrokes. Follow the steps below: ssh [email protected] ``` 2. If you would prefer to type `jupiter` rather than `myserver.com`, run this Bash script on your laptop. You'll be able to use this alias with: `rsync`, `scp`, and `ssh`. 
- 
        slowkow revised this gist Oct 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Save yourself a few keystrokes. Follow the steps below: At this point, you can connect to your server without typing a password: ```bash ssh username@myserver.com ``` 2. If you would prefer to type `jupter` rather than `myserver.com`, run this 
- 
        slowkow revised this gist Oct 12, 2014 . 2 changed files with 62 additions and 53 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ # How to ssh to a remote server without typing your password Save yourself a few keystrokes. Follow the steps below: 1. Run this Bash script on your laptop: ```bash #!/usr/bin/env bash # The hostname of your remote server. host=myserver.com # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh # Set the correct permissions (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh $host 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh $host 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' ``` At this point, you can connect to your server without typing a password: ```bash ssh myserver.com ``` 2. If you would prefer to type `jupter` rather than `myserver.com`, run this Bash script on your laptop. You'll be able to use this alias with: `rsync`, `scp`, and `ssh`. ```bash #!/usr/bin/env bash cat >> ~/.ssh/config <<END Host jupiter User carl HostName myserver.com END ``` 3. If you want a single command to do two steps: (1) connect to a login server `jupiter`, and then connect to a work server `saturn`, configure your `~/.ssh/config` file as follows: ``` # ~/.ssh/config Host jupiter User carl Hostname myserver.com Host saturn User carl ProxyCommand ssh -qX jupiter nc %h %p ``` 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 charactersOriginal file line number Diff line number Diff line change @@ -1,53 +0,0 @@ 
- 
        slowkow revised this gist Aug 14, 2014 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ # How to ssh to a remote server without typing your password # ========================================================== host=myserver.com # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh @@ -11,19 +13,18 @@ chmod 700 ~/.ssh ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh $host 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh $host 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Now you can connect to the remote server without typing your password ssh $host # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=jupiter user=carl cat >> ~/.ssh/config <<END Host $alias 
- 
        slowkow revised this gist May 27, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -44,7 +44,8 @@ Host jupiter Host saturn User carl ProxyCommand ssh -qX jupiter nc %h %p # ProxyCommand ssh -q -W %h:%p jupiter END # Now you can connect directly to the work server from your laptop 
- 
        slowkow revised this gist May 24, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ ssh myserver.com ssh jupiter # In one command: # ssh to a the login server and then the work server cat >> ~/.ssh/config <<END Host jupiter User carl 
- 
        slowkow revised this gist May 24, 2014 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +1,26 @@ # How to ssh to a remote server without typing your password # ========================================================== # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh # Set the correct permissions (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Now you can connect to the remote server without typing your password ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=jupiter user=carl host=myserver.com @@ -31,21 +31,21 @@ Host $alias HostName $host END # Now these two commands are equivalent ssh myserver.com ssh jupiter # In one command: # ssh to a login server and nc to a work server cat >> ~/.ssh/config <<END Host jupiter User carl Hostname myserver.com Host saturn User carl ProxyCommand ssh -q -W %h:%p jupiter END # Now you can connect directly to the work server from your laptop ssh saturn 
- 
        slowkow revised this gist Apr 3, 2014 . 1 changed file with 0 additions and 8 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -4,27 +4,21 @@ # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh # Set the correct permissions (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Now you can connect to the remote server without typing your password ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=jupiter @@ -41,7 +35,6 @@ END ssh myserver.com ssh jupiter # In one command: # ssh to a login server and nc to a work server cat >> ~/.ssh/config <<END @@ -54,6 +47,5 @@ Host saturn ProxyCommand ssh -qX jupiter nc %h %p END # Now you can connect directly to the work server from your laptop ssh saturn 
- 
        slowkow revised this gist Apr 3, 2014 . 1 changed file with 0 additions and 11 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -2,38 +2,31 @@ # ============================================================ # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh # Set the correct permissions (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Now you can connect to the remote server without typing your password ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=jupiter user=carl host=myserver.com @@ -45,15 +38,12 @@ Host $alias END # Now these two commands are equivalent ssh myserver.com ssh jupiter # In one command: # ssh to a login server and nc to a work server cat >> ~/.ssh/config <<END Host jupiter User carl @@ -66,5 +56,4 @@ END # Now you can connect directly to the work server from your laptop ssh saturn 
- 
        slowkow revised this gist Mar 12, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ host=myserver.com cat >> ~/.ssh/config <<END Host $alias User $username HostName $host END # Now these two commands are equivalent 
- 
        slowkow revised this gist Feb 5, 2014 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -31,8 +31,6 @@ ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) 
- 
        slowkow revised this gist Feb 5, 2014 . 1 changed file with 21 additions and 20 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=jupiter user=carl host=myserver.com @@ -50,22 +50,23 @@ END ssh myserver.com ssh jupiter # In one command: # ssh to a login server and nc to a work server cat >> ~/.ssh/config <<END Host jupiter User carl Hostname myserver.com Host saturn User carl ProxyCommand ssh -qX jupiter nc %h %p END # Now you can connect directly to the work server from your laptop ssh saturn 
- 
        slowkow revised this gist Feb 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -64,7 +64,7 @@ ssh saturn # # Host work # User simon # ProxyCommand ssh -qX login nc %h %p # # Now you can connect directly to work from your laptop # 
- 
        slowkow revised this gist Feb 4, 2014 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,13 @@ cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Now you can connect to the remote server without typing your password ssh myserver.com # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) 
- 
        slowkow revised this gist Feb 4, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -39,6 +39,12 @@ Host $alias HostName $domain END # Now these two commands are equivalent ssh myserver.com ssh saturn # Connect to a login server called login # and then connect a second time to a work server called work 
- 
        slowkow revised this gist Feb 4, 2014 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -6,27 +6,27 @@ mkdir ~/.ssh # Set the correct permissions (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server ssh-keygen -t rsa # Copy your public key to the remote server cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Create an alias for your server's address # (Use the alias with rsync, scp, ssh, etc.) alias=saturn 
- 
        slowkow revised this gist Feb 4, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -53,6 +53,6 @@ END # User simon # ProxyCommand ssh -qX A nc %h %p # # Now you can connect directly to work from your laptop # # ssh work 
- 
        slowkow revised this gist Feb 4, 2014 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -23,15 +23,15 @@ cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions. ssh myserver.com 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Create an alias for your server's address. # (Use the alias with rsync, scp, ssh, etc.) alias=saturn user=carl host=myserver.com cat >> ~/.ssh/config <<END Host $alias @@ -40,19 +40,19 @@ Host $alias END # Connect to a login server called login # and then connect a second time to a work server called work # # cat ~/.ssh/config # # Host login # User simon # Hostname myloginserver.com # # Host work # User simon # ProxyCommand ssh -qX A nc %h %p # # Now you can connect directly to B from your laptop # # ssh work 
- 
        slowkow created this gist Feb 4, 2014 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ # How to login to a remote server without typing your password # ============================================================ # Create this folder if it does not exist: ~/.ssh mkdir ~/.ssh # Set the correct permissions. (required) chmod 700 ~/.ssh # Generate an RSA key pair for identification with the remote server. ssh-keygen -t rsa # Copy your public key to the remote server. cat ~/.ssh/id_rsa.pub | ssh myserver.com 'cat >> ~/.ssh/authorized_keys' # ssh is very strict about correct permissions. ssh broad 'chmod g-w,o-w ~; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys' # Create an alias for your server's address. # (Use the alias with rsync, scp, ssh, ...) alias=fry user=simon host=my.server.com cat >> ~/.ssh/config <<END Host $alias User $username HostName $domain END # Connect to a login server A, # and then connect a second time to a work server B: # # cat ~/.ssh/config # # Host A # User simon # Hostname my.login-server.com # # Host B # User simon # ProxyCommand ssh -qX A nc %h %p # # Connect directly to B: # # ssh B