Skip to content

Quickly create ssh aliasses without manually editing ~/.ssh/config

Notifications You must be signed in to change notification settings

vjanssens/ssh-save-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

ssh-save-id

Already using ssh-copy-id? Great! But still manually adding the same configuration info to ~/.ssh/config? No more!

This script creates an alias in ~/.ssh/config based on your input.

Usage

$ ssh-save-id root@somehost.com

Typical use-case

$ ssh-copy-id root@somehost.com   // copies your public-key to the remote host ($ brew install ssh-copy-id)
$ ssh-save-id root@somehost.com   // uses the host-part as an alias in ~/.ssh/config
$ ssh somehost.com                // use the alias to connect to the remote host

Install

Download the script directly from GitHub:

$ curl -O https://raw.githubusercontent.com/vjanssens/ssh-save-id/master/ssh-save-id

Then ensure it is executable:

$ chmod a+x ssh-save-id

Drop it in your $PATH OR move it to a default location:

$ mv ssh-save-id /usr/local/bin/ssh-save-id

And test if it works:

$ ssh-save-id -h

Do you see the usage instructions as stated below? Great, start saving time!

Usage instructions

Usage: ssh-save-id [-h|-n] [-p port] user@hostname
-n: dry run    -- no aliasses are actually saved
-h: print this help

About

Quickly create ssh aliasses without manually editing ~/.ssh/config

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages