Skip to content

Install and configure SSH server to be safer.

Good night,

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:

AllowUsers USER
AllowGroups GROUP_USER
PasswordAuthentication yes
MaxStartups 2:100:2
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:

Edit /home/user/.profile

echo Put your password
read senha
if [ $senha == “SOMETHING” ]
then
# CODES THAT ALREADY ARE AT .profile
else
exit
fi

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.

Best Regards,
Matheus

References:
Desabilitar Comando SU
Informação MaxStartups

Published inLinuxShell Script

159 Comments

  1. как использовать бонусный счет казино 1win [url=http://1win5522.ru/]http://1win5522.ru/[/url]

  2. You’re so interesting! I don’t suppose I’ve read anything like that before. So good to find somebody with a few genuine thoughts on this topic. Really.. thank you for starting this up. This web site is one thing that is required on the internet, someone with a little originality!

  3. Heya i am for the first time here. I found this board and I find It really useful & it helped me out a lot. I hope to give something back and help others like you aided me.

  4. Thanks for one’s marvelous posting! I definitely enjoyed reading it, you may be a great author.I will be sure to bookmark your blog and will often come back in the future. I want to encourage you continue your great writing, have a nice afternoon!

  5. Hello to every one, the contents existing at this web site are truly amazing for people knowledge, well, keep up the nice work fellows.

  6. I needed to thank you for this fantastic read!! I absolutely loved every little bit of it. I’ve got you book marked to look at new things you post…

  7. A person essentially lend a hand to make critically posts I would state. This is the first time I frequented your web page and so far? I surprised with the analysis you made to make this actual put up incredible. Fantastic activity!

  8. Hi there, all is going perfectly here and ofcourse every one is sharing information, that’s in fact good, keep up writing.

  9. Vavada to znane kasyno online, które działa również w Polsce. Strona przyciąga graczy szeroką ofertą gier, przejrzystymi warunkami i obsługą w PLN (zł). Bonus powitalny oraz intuicyjna obsługa sprawiają, że platforma zdobyła popularność wśród polskich użytkowników.

  10. Vavada to znane kasyno online, które działa również w Polsce. Strona przyciąga graczy szeroką ofertą gier, przejrzystymi warunkami i obsługą w PLN (zł). Bonus powitalny oraz intuicyjna obsługa sprawiają, że platforma zdobyła popularność wśród polskich użytkowników.

Leave a Reply

Your email address will not be published. Required fields are marked *