cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

os:linux:user:ssh.html



Linux

ssh - How to configure ssh in Linux (sshd_config, ssh_config)

/etc/ssh/sshd_config

configuration of ssh deamon

Operation Configuration Explanation
UseDNS no
PermitEmptyPasswords no
PermitRootLogin no
PasswordAuthentication yes yes or no


/etc/ssh/ssh_config or ~/.ssh/config (600)

$ vi ~/.ssh/config
$ chmod 600 ~/.ssh/config
Configuration Explanation
host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null Ignore “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”
ServerAliveInterval 15
Example
# Don't listen yes/no.
host *
     StrictHostKeyChecking no

     # Ignore "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"
     UserKnownHostsFile=/dev/null

     ServerAliveInterval 15
host ALIAS
   HOSTNAME  IP or FQDN
   IdentityFile   PRIVATE-KEY-FILE


# ssh test1
Host test1
    HostName 192.168.100.100
    User user2
    IdentityFile ~/.ssh/test.privatekey

# ssh test2
Host test2
    HostName 192.168.100.100
    IdentityFile ~/.ssh/test.privatekey
    User user1
    ProxyCommand connect -H 192.168.0.10:9999 %h %p

# ssh test-server1, test-server2
Host test-server*
    user=user1
    IdentityFile ~/.ssh/test.privatekey

Host 192.168.0.100 192.168.0.101
    HostName 192.168.0.100 192.168.0.101
    IdentityFile ~/.ssh/privatekey





Linux




os/linux/user/ssh.html.txt · Last modified: 2018/02/17 by admin

Page Tools