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

228 Comments

  1. Looking for the Best Drive School of Motoring? Get expert driving lessons at best driving school for affordable and quality driving instruction.

  2. Oh my goodness! a tremendous article dude. Thanks However I am experiencing difficulty with ur rss . Don?t know why Unable to subscribe to it. Is there anyone getting similar rss drawback? Anybody who is aware of kindly respond. Thnkx

  3. Hello this is a wonderful write-up. I’m going to e mail this to my friends. I came on this while searching on yahoo I’ll be sure to come back. thanks for sharing.

  4. Nice blog here! Also your web site loads up very fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as fast as yours lol

  5. This is valuable stuff.In my opinion, if all website owners and bloggers developed their content they way you have, the internet will be a lot more useful than ever before.

  6. Wow, amazing blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is wonderful, let alone the content!

  7. Hello there, You have performed an incredible job. I will definitely digg it and personally suggest to my friends. I am sure they will be benefited from this site.

  8. Hi, possibly i’m being a little off topic here, but I was browsing your site and it looks stimulating. I’m writing a blog and trying to make it look neat, but everytime I touch it I mess something up. Did you design the blog yourself?

  9. Hello there, You have performed an incredible job. I will certainly digg it and in my opinion recommend to my friends. I’m sure they will be benefited from this site.

  10. Hello there, You have done a great job. I will definitely digg it and individually recommend to my friends. I’m confident they’ll be benefited from this web site.

  11. This is my first time i visit here. I found so many helpful stuff in your website especially its discussion. From the tons of responses on your posts, I guess I am not the only one having all the enjoyment here! keep up the excellent work

  12. Spot on with this write-up, I truly believe this website requirements a lot much more consideration. I’ll probably be once more to read much much more, thanks for that info.

  13. Another thing is that when searching for a good on-line electronics store, look for web shops that are continually updated, always keeping up-to-date with the hottest products, the most beneficial deals, and also helpful information on services and products. This will ensure you are dealing with a shop which stays ahead of the competition and provides you things to make educated, well-informed electronics expenditures. Thanks for the significant tips I’ve learned from your blog.

  14. Please let me know if you’re looking for a article writer for your blog. You have some really great articles and I believe I would be a good asset. If you ever want to take some of the load off, I’d love to write some articles for your blog in exchange for a link back to mine. Please shoot me an email if interested. Thanks!

  15. We absolutely love your blog and find the majority of your post’s to be exactly what I’m looking for. Do you offer guest writers to write content to suit your needs? I wouldn’t mind composing a post or elaborating on a number of the subjects you write about here. Again, awesome weblog!

  16. I’m in awe of the author’s talent to make complicated concepts accessible to readers of all backgrounds. This article is a testament to his expertise and dedication to providing useful insights. Thank you, author, for creating such an compelling and insightful piece. It has been an unforgettable experience to read!

Leave a Reply

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