2018-04-02 01:57:15 +02:00
|
|
|
# Use a custom port in the following range : 1024-65536
|
|
|
|
Port 22
|
2018-02-22 13:54:31 +01:00
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
#Prefer ed25519 & ECDSA keys rather than 2048 bit RSA
|
2018-06-06 00:10:58 +02:00
|
|
|
HostKey /etc/ssh/ssh_host_rsa_key
|
2018-04-01 19:22:55 +02:00
|
|
|
HostKey /etc/ssh/ssh_host_ecdsa_key
|
2018-02-22 13:54:31 +01:00
|
|
|
HostKey /etc/ssh/ssh_host_ed25519_key
|
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
# Allow root access with ssh keys
|
2018-02-22 13:54:31 +01:00
|
|
|
PermitRootLogin without-password
|
2018-04-01 19:22:55 +02:00
|
|
|
|
|
|
|
# Allow ssh access to some users only
|
2019-02-05 20:14:59 +01:00
|
|
|
AllowUsers root ubuntu
|
2018-02-22 13:54:31 +01:00
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
# allow ssh key Authentication
|
2018-02-22 13:54:31 +01:00
|
|
|
PubkeyAuthentication yes
|
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
# ssh keys path in ~/.ssh/authorized_keys
|
2018-02-22 13:54:31 +01:00
|
|
|
AuthorizedKeysFile %h/.ssh/authorized_keys
|
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
# No password or empty passwords Authentication
|
2018-02-22 13:54:31 +01:00
|
|
|
PasswordAuthentication no
|
|
|
|
PermitEmptyPasswords no
|
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
# No challenge response Authentication
|
2018-02-22 13:54:31 +01:00
|
|
|
ChallengeResponseAuthentication no
|
|
|
|
|
2018-04-01 19:22:55 +02:00
|
|
|
UsePAM yes
|
2018-02-22 13:54:31 +01:00
|
|
|
X11Forwarding yes
|
|
|
|
|
|
|
|
#PrintMotd no
|
|
|
|
|
|
|
|
# Allow client to pass locale environment variables
|
|
|
|
AcceptEnv LANG LC_*
|
|
|
|
|
|
|
|
# override default of no subsystems
|
|
|
|
Subsystem sftp /usr/lib/openssh/sftp-server
|
|
|
|
|
2018-10-13 15:04:41 +02:00
|
|
|
# Host keys the client accepts - order here is honored by OpenSSH
|
|
|
|
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
|
|
|
|
|
2018-11-19 10:30:34 +01:00
|
|
|
# use strong ciphers
|
|
|
|
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
|
|
|
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
2019-02-05 20:14:59 +01:00
|
|
|
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|