how to setp up a ssh server using openssh with rsa public private keys (ubuntu server): first you need to install it
sudo apt-get install openssh-server
now you need to make a public and private key
ssh-keygen -t rsa -b 4096
your keys will be at /home/me/.ssh id_rsa and id_rsa.pub (if you didn't change the name) now we should edit the config file /etc/ssh/sshd_config first change the protocol from 2, 1 to 2 only if you want you can change the port the change the AuthorizedKeyFile from $h/.ssh/authorized keys to $h/.ssh/id_rsa.pub then change the password authentication to no to make sure you are safe from brutforce attacks
Protocol 2 Port 22 AuthorizedKeysFile $h/.ssh/id_rsa.pub PasswordAuthentication no
after saving it you can run it with this command
service ssh start
now you need to move the fil id_rsa to a usb drive(not safe to email it to yourself) and connect with this command
ssh -i /path/to/id_dsa me@myserver.com
if you have a windows and you want to connect to the server download putty and puttykeygen open the putty key generator click on conversions and import key the click the "save the private key button" the file that you created with the extension of .ppk is the one that you will use with putty to connect to the sever