Basic SSH Configuration (Ubuntu Server 16.04)

Опубликовано: 10 Октябрь 2024
на канале: MushaGH
2,661
11

Basic SSH Server configuration
-------------------------------

1) Install SSH Server
$ sudo apt update
$ sudo apt install openssh-server
*note: for older version of ubuntu use "apt-get"

$ sudo systemctl enable ssh
$ sudo systemctl start ssh

*note: ssh run on port 22

2) Basic Configuration
Change port number
Port 22222

Set maximum login attempt to 3 (default is 6)
MaxAuthTries=3

Disable password authentication
PasswordAuthentication no

Restart SSH server
sudo systemctl restart ssh

now we need to use the private key to login to server

3) Connecting to ssh server using public key
Check .ssh directory and make sure "authorized_keys" is available,
$ ls ~/.ssh/
$ touch ~/.ssh/authorized_keys

Create SSH Keys (for linux only) for windows please use (putty keygen)
$ ssh-keygen

Check for your public key
$ cat ~/.ssh/id_rsa.pub

4) Download Link
Putty -- https://cnhv.co/23t2
puttygen -- https://cnhv.co/23v0