All I want to do is. . .

. . .setup and use SSH.


Description: This is the template page.
Contributors: anschwa
Updated: 10/10/15

Genarating and sharing public key

How to create a new public key for ssh and add it to the remote machine.

generate key:

ssh-keygen -t rsa

Append it to the server:

cat ~/.ssh/ | ssh user@server "cat >> ~/.ssh/authorized_keys"

Copy a file to the remote machine:

scp ~/path/to/file user@server:/path/on/server

Copy a file from the remote machine:

scp user@server:/path/to/file ~/path/on/local

SSH Config

Creating a ~/.ssh/config file. Having aliases for SSH is a dream.

    Host somealias
        Port 2222
        User someuser
        IdentityFile  ~/.ssh/id_example
        IdentitiesOnly yes

    Host anotheralias
        User anotheruser
        PubkeyAuthentication no

    How aws
        User awsuser
        IdentityFile  ~/.ssh/aws_identity.pem
        IdentitiesOnly yes

Usage: ssh somealias

  • HostName - The server host (domain or ipaddress)
  • Port - The port to use when connecting
  • User - The username to log in with
  • IdentityFile - The SSH key identity to use to log in with, if using SSH key access
  • IdentitiesOnly - "Yes" to specify only attempting to log in via SSH key
  • PubkeyAuthentication - "No" to specify you wish to bypass attempting SSH key authentication


If you have suggestions, corrections, or content to contribute, fork us at our Github repo or open an issue.

Licensed under the CC-SA.