Using ssh config to save settings and make your life easier – Exotic Security

From Fiamma
Jump to navigationJump to search

https://xo.tc/using-ssh-config-to-save-settings-and-make-your-life-easier.html
Using ssh config to save settings and make your life easier – Exotic Security

Complexity: 6 Rating: 6


HashKnownHosts no

###############################################################################
# Servers                                                                     #
###############################################################################
Host example.com www.example.com brand.example.com
    IdentityFile ~/.ssh/Michael-Van-Delft.id_rsa
    User michael

# Port forwarding for I2P. Simply run `ssh I2P_Router`
# then browse to http://localhost:7657/
Host I2P_Router
    HostName example.net
    IdentityFile ~/.ssh/Michael-Van-Delft.id_rsa
    User i2p_user
    LocalForward 7657 localhost:7657
    LocalForward 4444 localhost:4444
    LocalForward 6668 localhost:6668

# Example of a local server with IPv6 only
Host zilean
    IdentityFile ~/.ssh/pi@zilean.example.com.id_rsa
    User pi
    AddressFamily inet6
    HostName 2001:0db8:6101:cc01::7