To install ssh server in Ubuntu use:
$ sudo apt-get install openssh-server
To let it safer edit /etc/ssh/sshd_config
$ sudo vi /etc/ssh/sshd_config
Than change the lines:
Port XXX # Change the port
What MaxStartups do? Specify the number of un authenticated connections in server. The syntax is start:percent:max. Example: 10:50:20. When it gets to 10 connections it will start with the percent. So every new connection will have 50% of chance to be automaticlly refused. When it gets to 20. It will denied ALL the new connections.
If you want, you can ask for a second password, if you type it wrong, it will close the connection:
echo Put your password
if [ $senha == "SOMETHING" ]
# CODES THAT ALREADY ARE AT .profile
With this you can do some tricks, to create a new RANDOM password every time somebody connect and send it to your e-mail. So you will need to put your normal password, than access your e-mail account, verify the new password and type it.