To get openssh server:
sudo apt-get install openssh-server
That’s it! Use your SSH clients to connect to your machine using the default port 22.
If you wish to change the connection port, run the commands below to open the configuration file.
sudo gedit /etc/ssh/sshd_config
Find the line:
# What ports, IPs and protocols we listen for
Then change the port # shown to whatever you want, for example, 3391 and save the file.
But remember to use the new port number every time you want to connect to your system via SSH.