mkdir -p $HOME/.ssh chmod 0700 $HOME/.ssh Create the key pair : ~> ssh-keygen -t rsa -b 4096 -f ~/.ssh/VM115.key -C "OpenSuse-VM-Server" Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/ms/.ssh/VM115.key. Your public key has been saved in /home/ms/.ssh/VM115.key.pub. The key fingerprint is: SHA256:j4yPQaH1De1nsRbg/V3wMWEVrnHtU9bAPfm4bUcNgD0 OpenSuse-VM-Server The key's randomart image is: +---[RSA 4096]----+ | .o.ooB*| | o.oE =**| | o . o +o =@| | o o + ==+*| | . . S o =..=o| | . o o + . =| | o o . ..| | + | | . . | +----[SHA256]-----+ Install the public key in remote server : ms@localhost:~> ssh-copy-id -i /home/ms/.ssh/VM115.key.pub max3@192.168.1.115 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/ms/.ssh/VM115.key.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys Password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'max3@192.168.1.115'" and check to make sure that only the key(s) you wanted were added. Disable the password based login on a server: max:/home/max3 # nano /etc/ssh/sshd_config PasswordAuthentication no PermitEmptyPasswords no => ACHTUNG : PermitRootLogin no => use sudo max3 UsePAM no max2@install:~> sudo rcsshd restart ---------------------------------- sudo zypper install fail2ban sudo nano /etc/fail2ban/jail.conf