How to protect Linux from Hackers // My server security strategy!

  Рет қаралды 208,943

Christian Lempa

Christian Lempa

Күн бұрын

How To Protect Linux From Hackers, Malware, and other bad things that could infect your server! I'll show you my server security strategy that might help you as well when you're running a Linux Server and hosting containerized applications. #Linux #Cybersecurity #HomeLab
How to use a VPN: • Tailscale VPN - WireGu...
Use a Reverse Proxy: • Nginx Proxy Manager - ...
Update Docker with Watchtower: • How To Update Docker C...
Tailscale VPN: • Tailscale VPN - WireGu...
Get started with Docker: • How to use Docker and ...
Teleport-*: goteleport.com/thedigitallife
Follow me:
TWITTER: / christianlempa
INSTAGRAM: / christianlempa
DISCORD: / discord
GITHUB: github.com/christianlempa
PATREON: / christianlempa
MY EQUIPMENT: kit.co/christianlempa
Timestamps:
00:00 - Introduction
00:43 - Plan your own security strategy!
02:03 - Update your software
04:28 - Don't forget your Docker containers
06:18 - Secure your SSH Access
13:24 - Use 2FA and an Access Proxy
15:48 - Don't expose unused services
17:36 - Use a firewall
21:21 - Use a reverse proxy when possible
23:12 - Use VPNs, DMZs, and access gateways
24:59 - Use an IPS (Intrusion Prevention System)
27:37 - Isolate Applications with Docker
________________
All links with "*" are affiliate links.

Пікірлер: 242
@unknowntechio
@unknowntechio Жыл бұрын
One of the best posts on security, open source server security i've watched. Simply great!
@CRK1918
@CRK1918 Жыл бұрын
Another of the most important thing is network security, and your home network design. Using pfSense at network level. You talked about some of the DMZ setup. Using VLAN to separate networks, home networks, IoT networks, server network and so on.
@confluxmedia1719
@confluxmedia1719 2 жыл бұрын
Thanks for bringing this topic up! This is what I needed so much.
@christianlempa
@christianlempa 2 жыл бұрын
Sure! Glad it helped you 😁
@mrmotomoto
@mrmotomoto Жыл бұрын
Thanks for the quality content! You're such a wealth of information and we appreciate you sharing it
@christianlempa
@christianlempa Жыл бұрын
Thank you so much! :)
@g-net7646
@g-net7646 2 жыл бұрын
Another great video thanks! It would be great if you could go into more detail on how to address the firewall security issue using UFW of the docker containers and how you address them for cloud hosted servers.
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! Yeah I thought about making a more in-depth video about UFW and IPTables, I'll put that on the backlog list ;)
@Asdasdas1337
@Asdasdas1337 2 жыл бұрын
If im not wrong docker doesnt play nice with UFW and tends to write its own rules in a way which supersedes ufw rules. I switched to firewalld because of this and I highly recommend it.
@LtdJorge
@LtdJorge 2 жыл бұрын
@@Asdasdas1337 yep, UFW writes iptables rules, and docker too. That's why they have conflicts.
@JoseFerreira-xm3zy
@JoseFerreira-xm3zy 2 жыл бұрын
Once again, another great video. Thank you for your service ! :)
@christianlempa
@christianlempa 2 жыл бұрын
Thank you so much :)
@johnwillemsen6872
@johnwillemsen6872 2 жыл бұрын
I think you're awesome, man. Keep on keeping on!
@christianlempa
@christianlempa 2 жыл бұрын
Thank you mate!
@SimarMannSingh
@SimarMannSingh Жыл бұрын
I honestly want to see your channel grow exponentially... May you get a few million subscribers real soon. Just keep maintaining your video's quality and pace...
@christianlempa
@christianlempa Жыл бұрын
Thank you so much :)
@kuhluhOG
@kuhluhOG 9 ай бұрын
5:55 I run my containers via podman in systemd units and create the descriptions via quadlet. That way I can just regularly let the system call "podman auto-update" and I am done (it also rolls it back in case the update doesn't work, but it relies on support from the containers here which may not necessarily be available).
@moeinmhzg7827
@moeinmhzg7827 2 жыл бұрын
Awsome and on point as always Thank you
@christianlempa
@christianlempa 2 жыл бұрын
Thank you :)
@cybersecurehacks
@cybersecurehacks 2 жыл бұрын
Excellent Videos mate.... And thank you for sharing stuff like this..
@christianlempa
@christianlempa 2 жыл бұрын
Thank you so much :)
@wamiedabdel-rahman5389
@wamiedabdel-rahman5389 2 жыл бұрын
Nice and very useful video as usual. I liked your command prompt. How can I implement it on my Ubuntu system?
@mithubopensourcelab482
@mithubopensourcelab482 2 жыл бұрын
Great video. What we do for security ? The best way is to install every server as a vm on a separate isolated vlan, apply all your suggestions. Hopefully nothing will infect your server, and even if it does, the infection will remain isolated and easily taken care of using snapshots or backups. We have applied this strategy and so far, so good, we are in safe heavens since 2 years. Not to forget, your virtualiser needs to be well protected as well.
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! Great ideas
@minscj
@minscj 2 жыл бұрын
Please can you tell me how to do this for my servers
@carloslaguera8025
@carloslaguera8025 Жыл бұрын
@@minscj Unfortunately, this is all a bit more complicated and inconvenient. On my Proxmox host I have looped each VM through to the firewall with its own vlan. All have their own IP range and are secured with all firewall rules to each other. So to say I have an independent DMZ for each VM. Any communication between the VMs has to go through the firewall by force and is allowed with filigree rules. As I said. Everything a „bit“ more complicated :)
@andrewgraham6994
@andrewgraham6994 6 ай бұрын
broski explains things perfectly.. RESPECT AND LUV
@christianlempa
@christianlempa 5 ай бұрын
thx lol :D
@wildflowers465
@wildflowers465 Жыл бұрын
Great video! Running ss or netstat as root (with sudo) will show the PID/Program name in the final column, which is helpful if you don't already know what ports services commonly use, for well known ports or registered ports, as well as for ephemeral ports
@christianlempa
@christianlempa Жыл бұрын
Thanks for sharing! :)
@nichdiekuh
@nichdiekuh Жыл бұрын
This video is super interesting. Especially the part about Docker and iptables couldn't be stated enough. However I think that you could have also mentioned how to prevent docker from opening ports, that seem to be closed in the UFW rules. I had this issue a couple of days ago with a production system which unfortuantely wasn't protected by an external firewall. I was able to fix this in a couple of minutes, but for the novice admins, who are probably the target audience of this video, it certainly isn't that trivial to fix. btw: I only discovered your channel a few days ago and even for me as a professional linux admin, it's interesting content. I'm looking forward to seeing more from you 🙂
@Pharaon2502
@Pharaon2502 Жыл бұрын
Any more info how you have done this?
@NickBouwhuis
@NickBouwhuis 2 жыл бұрын
In 2021, I would recommend creating a Ed25519 key instead of a RSA key. Ed25519 offers stronger encryption and shorter keys. Only downside is that it is incompatible with older systems (older then say, 5 or 6 years?)
@christianlempa
@christianlempa 2 жыл бұрын
Yeah it's a good idea, the incompatiblity is the the major reason why I still don't include it, when RSA 4096 should be still fine. Second reason is I can't remember that stupid number 25519... who choose this name?!
@coolcax99
@coolcax99 2 жыл бұрын
@@christianlempa Its the prime number field used in the eliptical curve. 2^255 - 19.
@danilodistefanis5990
@danilodistefanis5990 2 жыл бұрын
Karthik Sriram oh, that makes it way easier.
@comic-typ5919
@comic-typ5919 Жыл бұрын
@@danilodistefanis5990 xD
@l_shaun_bunds_l
@l_shaun_bunds_l 5 ай бұрын
thanks for the information. the elliptical curve of erectile dysfunction is nothing to sublimate your libidinal acronyms by! That it is stupid is an easieer way to feel...
@alfredoramos1450
@alfredoramos1450 2 жыл бұрын
I hit the "subscribe" button and clicked "all" on the bell 🔔 great video sir!
@christianlempa
@christianlempa 2 жыл бұрын
Thank you 🥰
@LawrenceSingha
@LawrenceSingha 2 жыл бұрын
Hi from London, I have subscribed and new to your channel. Thank you so much for tips and what I needed so much & very useful.
@christianlempa
@christianlempa 2 жыл бұрын
Awesome! Thank you!
@themadtux
@themadtux 2 жыл бұрын
Great Video! Curious what shell prompt are you using in your SSH tutorial? Really like that look...
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! I'm now using a new prompt which is called starship, you can take a look here: kzfaq.info/get/bejne/d7FifahjvtmvpKM.html
@ahmadmobaraki7371
@ahmadmobaraki7371 2 жыл бұрын
you are awesome man!! thank you.
@christianlempa
@christianlempa 2 жыл бұрын
You, too! Thanks ❤
@Taragurung
@Taragurung 2 жыл бұрын
Recently following you, great content. what have you used for the terminal, looks different?
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! I recently made a video about my development setup, how that is what you're searching for: kzfaq.info/get/bejne/paxmmq-qzbeolKs.html
@nolmirk2267
@nolmirk2267 2 жыл бұрын
you the man, thank you.
@ctheroux
@ctheroux 2 жыл бұрын
Hi, thanks for the video. Very good. Btw, what model of keyboard you are using? Regards
@christianlempa
@christianlempa 2 жыл бұрын
You're welcome, thanks! Currently the logitect G413 ;)
@Berkto00
@Berkto00 8 ай бұрын
Subject: How to protect Linux from Hackers // My server security strategy! Rule1: don't tell hackers about your server security strategy Just joking :D great content Christian, keep on going! Regards from Czechia :)
@Signal_Intelligence
@Signal_Intelligence Жыл бұрын
Great video Christian
@michelangelop3923
@michelangelop3923 2 жыл бұрын
For 2FA in the shell I use DUO Security, with a free account you can do pretty much everything, I employ the least privilege access so I have a non sudo account for docker management and access with a pub key, for sudo I login with su to a local admin account, and for the actual sudo to execute a duo push is needed.
@Reiner030
@Reiner030 2 жыл бұрын
looks also interesting like Teleport does. But why relying on external services which can have connection/service problems while you need to login (independent they costs if not community edition is used) when you can do it with "Yubikey and SSH via PAM" by installing and configuring a package yourself and having only a Yubikey, Nitrokey or similar key buyed once for each user? Maybe only interesting solution could be to protect a suite of hard- and software by same 2FA service.
@knightride9635
@knightride9635 2 жыл бұрын
Great video, I will have to watch it at least 10 times to implement all this.
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate 😁
@miraldoramos
@miraldoramos 2 жыл бұрын
Hi, you can use Ssh-copy-id for copying SSH keys to servers. nice video, thx
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! Yeah I'm still so used to the old way :D
@sbrodriguez1980
@sbrodriguez1980 2 жыл бұрын
very very very good and interesting video. Congrats!!!
@christianlempa
@christianlempa 2 жыл бұрын
Thanks bro 💯
@wanessasilva4541
@wanessasilva4541 2 жыл бұрын
I learned so much on a single command line! 7:21
@christianlempa
@christianlempa 2 жыл бұрын
Awesome! 😀
@manaberry
@manaberry 5 ай бұрын
Hi! How should I use the DMZ? I have 2 server. One host all my services in docker (nginx proxy manager, website, cloud services, apps, etc...) and I have a Raspberry with Adguard (and my TLS DNS) and a plex server. Should I move plex to the big one, and nginx to the small one and make the raspberry as dmz landzone to manage all traffic? Would it isolate the main server correctly? Thanks for helping!
@manjunathreddy5966
@manjunathreddy5966 5 ай бұрын
Wow. The quality.
@scottamolinari
@scottamolinari 7 ай бұрын
Something else you can do is move the ssh port. Port 22 is well known and thus hackers hit it all the time basically automatically. You can move ssh traffic to a different port and close 22. It's only security via obscurity I know, but it avoids those automated hacking attempts.
@E57det7I
@E57det7I 6 ай бұрын
Yeah, this didn't used to really do much. But I can see this actually becoming more and more helpful the more and more automated bots just hit 22
@GorkemYildirim
@GorkemYildirim 2 жыл бұрын
Great video, Thanks a lot.
@christianlempa
@christianlempa 2 жыл бұрын
Thanks!
@ronm6585
@ronm6585 Жыл бұрын
Thank you.
@christianlempa
@christianlempa Жыл бұрын
You're welcome!
@gregm.6945
@gregm.6945 2 жыл бұрын
great video, thanks !.....don't forget, you could've used _ssh-copy-id_ @ 11:08
@christianlempa
@christianlempa 2 жыл бұрын
Thanks! Oh yeah, I'm still so used to the old way 🙈
@fbifido2
@fbifido2 2 жыл бұрын
@26:48 - how do you make fail2ban work on all running service or all open ports ? @26:58 - what will it show if you removed the sshd
@Watsitsname08
@Watsitsname08 2 жыл бұрын
Hi Christian, this video really helped me in my research prior to deploying my first home server. I do, however, have a few questions about securing my server and my data. Assuming I am running ubuntu: what would be the best way to share folders across my home network (to other Windows devices) and ensure that I'm protected from attacks outside my server. I will have a total of 3 users accessing these shared folders, including myself. Any help here would be greatly appreciated, or if you can provide a resource that would be helpful too. Thanks.
@christianlempa
@christianlempa 2 жыл бұрын
Depends a lot on how you're securing your home network and who has access. I personally would not let anything unauthorized and unencrypted into my home network, I can just recommend use a firewall solution, VPNs or Access Proxies. From inside the network it's a bit more difficult, there it might be a good idea to isolate the server in a separate network (DMZ), I'm doing this right now in my Homelab, check out in the next 2 weeks there is a firewall video coming out, that will explain this.
@Watsitsname08
@Watsitsname08 2 жыл бұрын
@@christianlempa Awesome. Thanks for the response. There is still so much to learn about this and I'm loving it. All of your videos are so helpful.
@popquizzz
@popquizzz 2 жыл бұрын
I found your channel today and I am thrilled that you are so willing to share such pertinent information. One request I do have to ask is if you would just reduce your background music a bit. This should be a nuance addition to any video especially one's like yours with so much good info shared. The music is a bit too much at times and the mundane aspect of it distracts from your lessons and not in a good way. We want to hear what you have to say, not fight the music to hear you. Thanks Christian!
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! Awesome feedback :) Well, I need to admit that in this video the background music is louder than usual, don't know what was going on :D But you're right! I'll reduce it in next videos even more.
@HosselBossel
@HosselBossel Ай бұрын
Thanks!
@christianlempa
@christianlempa Ай бұрын
Thank you so much bro for your support ❤️
@itasev
@itasev 2 жыл бұрын
Hi Christian, I cant find a decent how to setup a XMPP server on AWS or Hetzner from scratch. In the era of self-relying on privacy you might find it interesting to make such a video or post on your website. Cheers!
@christianlempa
@christianlempa 2 жыл бұрын
Well that would be far down my priority list, to be honest :/
@kcyeohmy
@kcyeohmy 2 жыл бұрын
Yes. Some security feature will be always better than none. Of course not all secure server are unhackable but to at least leave less port open. Use longer time to get stolen or own. Similar to your car if you don't have car alarm or steering lock. Car theft can happen within 1 to 5 minutes but if you have the security wheel lock gear lock brake lock will at least waste some of the car theft time. Even pentagon or military still get hack this is most secure but still got hacked. Good share. Thank you.
@christianlempa
@christianlempa 2 жыл бұрын
💯 agree!
@str0g
@str0g Жыл бұрын
could you do a yubi key authentication integration on linux?
@rajufelix3070
@rajufelix3070 2 жыл бұрын
Great
@whylde7834
@whylde7834 2 жыл бұрын
Thank you Christian.
@christianlempa
@christianlempa 2 жыл бұрын
You're welcome
@mattplaygamez
@mattplaygamez Жыл бұрын
Tailscale has also added tailscale ssh it Also is like An acces Proxy
@kjakobsen
@kjakobsen Жыл бұрын
Docker is a rabbithole, but such an interesting one. :)
@christianlempa
@christianlempa Жыл бұрын
It really is!
@rscmcl
@rscmcl 2 жыл бұрын
I added 2FA to my home ssh server when I want to log from somewhere else, works amazing... uses the key and fallback to password/2FA
@christianlempa
@christianlempa 2 жыл бұрын
Very nice!
@SomeGuyWatchingYoutube
@SomeGuyWatchingYoutube Жыл бұрын
Do you set up TPM for Linux?
@abstractumx
@abstractumx Жыл бұрын
how can i set the terminal with your same graphic theme. seems very cool!
@stephaneislistening6103
@stephaneislistening6103 2 жыл бұрын
What if we loose the SSH keys file ? We cannot log in any longer if we had disabled password login ?
@sysdrum
@sysdrum 2 жыл бұрын
Great stuff
@christianlempa
@christianlempa 2 жыл бұрын
thanks :)
@jojohnes5863
@jojohnes5863 2 жыл бұрын
Hallo Christian, tolle Videos! Du hast ja viele Videos zu Docker etc. Den Aspekt, dass Docker Container die Firewall aber umgehen, reißt Du aber nur hier kurz an. Ich denke das ist sehr wichtig. Viele installieren jetzt fleißig Docker Container und wiegen sich in Sicherheit, die so gar nciht gegeben ist. Kannst Du nicht mal ein Video dazu machen, wie man auch Docker mit der Firewall sicher absichern kann?
@christianlempa
@christianlempa 2 жыл бұрын
Hey danke für dein feedback! Ich werde wahrscheinlich kein eigenes video dazu machen, weil ich im Prinzip alles wichtige gesagt habe. Allerdings glaube ich dass ich es öfter in meinen Videos sagen muss, wenn auch immer es um firewalls und linux Sicherheit geht. Vielen Dank!
@jojohnes5863
@jojohnes5863 2 жыл бұрын
@@christianlempa Danke für die Antwort. Ich glaube allerdings nicht, dass Otto Normal user "ich schau das youtube video und schmeiß mir die Docker Container drauf" damit damit docker sicher absichern kann. Viele führen nur die Schritte im Video aus, und die reichen nicht..,.. Wenn kein eigenes Video, dann vll in Deine Anleitungen zu Docker im Blog, oder in den Artiel zum wireguard mit docker. Versteht mich nicht falsch, die Videos sind klasse, aber wenn Du zb Docker ausführlich vorstellst, solltest Du auch sagen, wie man es absichert. Sonst rennen die Leute ins Verderben:)
@KratomSyndicate
@KratomSyndicate Жыл бұрын
what do you think about ufw-docker?
@SvenTimmermann
@SvenTimmermann 2 жыл бұрын
Good video. But take a look at ed255... Ssh keys :)
@christianlempa
@christianlempa 2 жыл бұрын
Yeah, maybe if I remember next time :P
@kjakobsen
@kjakobsen Жыл бұрын
First step is to protect the server against compromise. Next step is to have a reliable backup and disaster recovery plan in place,, for when it eventually happens despite everything you did right. ;)
@christianlempa
@christianlempa Жыл бұрын
Absolutely! Great points :)
@peterlemmington6585
@peterlemmington6585 2 жыл бұрын
Heftiger Typ!
@anarchoN3rd
@anarchoN3rd 2 жыл бұрын
For any other noob who got lost when they got to the intro to the 'ss' command, you need to use sudo to display the process IDs (what the p flag in -ltnp displays)
@christianlempa
@christianlempa 2 жыл бұрын
thanks mate! Yeah I was a bit confused until realizing it in the editing :D
@anarchoN3rd
@anarchoN3rd 2 жыл бұрын
@@christianlempa no problem. As someone who's only knowledge of ports is that 22 is for ssh, having those descriptors was very helpful. I even tried removing the -n tag, but it seems like ss has some trouble resolving those names.
@masoudamiri7941
@masoudamiri7941 2 жыл бұрын
hello sir , can you please make a video about installing windows server on digital ocean vps ?
@christianlempa
@christianlempa 2 жыл бұрын
Hm that's probably not what I'm focussing on right now, I'm sorry.
@shuangliu2204
@shuangliu2204 2 жыл бұрын
what time do you do a live streaming ? here from china, has a different timezone
@christianlempa
@christianlempa 2 жыл бұрын
Hey bro, Usually Thursday 5pm CET, but recently I wasn't live a lot, unfortunately :( Btw, you see the scheduled ones in the subscription feed as well!
@michaelgoehringer
@michaelgoehringer 2 жыл бұрын
Hi, did my previous question get deleted? Wanted to know if it works to install fail2ban via ecex console direcly in the container of bitwarden and nextcloud to protect them from brude force attacks or doesn't it work this way? But what would be the alternative?
@christianlempa
@christianlempa 2 жыл бұрын
Don't know why YT sometimes deletes comments.. well you can configure fail2ban to look at the logfiles from the containers. Usually docker stores the logfiles in the /var/lib/docker/containers//.json.log file.
@michaelgoehringer
@michaelgoehringer 2 жыл бұрын
@The Digital Life I meant something else. Where do I have to install fail2ban so that I can protect Bitwarden and nextcloud (in containers and in the public network via NGINX Proxy Manager) against brute force attacks. Directly on my raspberry pi? In the respective containers etc.?
@BrandonCallifornia
@BrandonCallifornia 2 жыл бұрын
Hey Christian! Why don’t ya use ssh-copy-id -I keyfile hostnamelikeinssh???
@christianlempa
@christianlempa 2 жыл бұрын
Good question, I guess I'm still used to the old way :D
@209rodriguez
@209rodriguez Жыл бұрын
How can I organize what needs to be updated like an apk file. Where should I save it to auto update?
@mcdazz2011
@mcdazz2011 Жыл бұрын
I used to use UFW on all my servers - but, I ended up moving to iptables because UFW had a habit of dying after 30,000 plus IP addresses were blocked. I haven't run into that problem with iptables, but it's always possible it was a memory issue.
@christianlempa
@christianlempa Жыл бұрын
Wow, I will never run in that kind of issue with my small home lab, but well that might be a problem yeah.
@esra_erimez
@esra_erimez 2 жыл бұрын
Security is a journey, not a destination
@christianlempa
@christianlempa 2 жыл бұрын
💯 agreed
@HoshPak
@HoshPak 2 жыл бұрын
Another good addition to reducing the attack surface is using non-standard ports i.e. anything above port 2048. Most scripts only poke around those ports and skip the rest as it significantly increases scanning time. A practical way of doing that is running a honey pot on port 22 while moving your actual SSH service somewhere else.
@christianlempa
@christianlempa 2 жыл бұрын
Yeah you can think about that. I didn't include it as I generally avoid to expose this port directly, but still a good option to get rid of annoying logs ;)
@---GOD---
@---GOD--- 2 жыл бұрын
It takes half a second to scan all of your ports. Maybe you'll stop a few basic script kiddies who only target known ports like 22... but this literally does almost nothing to protect you.
@Becoming-Human
@Becoming-Human 2 жыл бұрын
Future video series idea... assessing the security benefits of NixOS and Guix OS as they compare to {insert mainstream Linux OS here}. To be fair, though, please note the considerable learning curves associated with each of the aforementioned OS'es... you have been warned. :-)
@christianlempa
@christianlempa 2 жыл бұрын
Well, I haven't looked at these distros, yet.
@johnnytank979
@johnnytank979 2 жыл бұрын
Great video! I think you could speak a little bit slower, I feel slightly rushed when I try to comprehend what you are executing exactly. ;)
@christianlempa
@christianlempa 2 жыл бұрын
Thanks' :D Yeah, I try to slow it down a little bit. But it's hard to find that perfect balance that everybody enjoys. Most stuff on YT is fast, otherwise people are just leaving :/
@marcello4258
@marcello4258 2 жыл бұрын
thanks again christian. perhaps if you allow I'd like to add that limit instead of allow might be better on port 22 otherwise no one is held back from brut forcing although it might be hard anyway since you permit keys only but it is not reply more work
@christianlempa
@christianlempa 2 жыл бұрын
good suggestions! thanks ;)
@typingcat
@typingcat 2 жыл бұрын
What do the seemingly random numbers at the beginning of the files mean? I saw similar numbers in polkit configuration files.
@Halomaster4ever
@Halomaster4ever Жыл бұрын
When dealing with newer programs that have multiple configuration files, you can use the numbers at the beginning to determine in which order they're read. One common example is the messages you get when you log into modern Ubuntu servers. It gives you information about your server, but actually they're made up of different scripts ran from a specified folder. You can then insert your own scripts before/after the existing scripts depending on the number you set the file to. Lowest number wins in this case. I'm not 100% sure, but in theory you probably don't NEED to use numbers, it's just a human way of ordering things.
@VulcanOnWheels
@VulcanOnWheels 2 жыл бұрын
18:48 I thought that enabling a service would only make it active after the next startup of your computer and that you have to add --now to make it work immediately. 28:12 You speak so fluently(!), but the way you say "determine"...?
@asimabusallam3147
@asimabusallam3147 2 жыл бұрын
nice
@pj6206
@pj6206 4 ай бұрын
Is there any git repository for this tutorial? 🙂
@ChuckNorris-lf6vo
@ChuckNorris-lf6vo 2 жыл бұрын
What is this Terminal you are using, it looks cool and seems to suggest things?
@christianlempa
@christianlempa 2 жыл бұрын
Windows Terminal + ZSH + autosuggestions
@SamSam-ic7qm
@SamSam-ic7qm Жыл бұрын
Can I have opinions on some of strategy I use: 1. SSH Access only by key, no password 2. Use fail2ban, block 24 hours on 1st bad attempt 3. Optional (Only allow ssh from specific IP) Thanks
@christianlempa
@christianlempa Жыл бұрын
Sounds like a good solution!
@JohnyDev
@JohnyDev Жыл бұрын
Can you please share what you have in the ".bashrc" PS1 how you have the ubuntu logo and the directory upwards the terminal text, thank you
@christianlempa
@christianlempa Жыл бұрын
It's in my dotfiles on github
@JohnyDev
@JohnyDev Жыл бұрын
@@christianlempa Thank you so much 😊
@typingcat
@typingcat 2 жыл бұрын
What the, so SSH doesn't block that tries too make wrong passwords out-of-the-box and I have install a third-party utility?
@Voigt_Analytics
@Voigt_Analytics 2 ай бұрын
Is there any web-based control panel for all of these mentioned security rules and concepts? I've heard, Portainer is able to some security tasks. But not all of my services are docker based containers. I need an overview, better than ss -ltpn
@christianlempa
@christianlempa 2 ай бұрын
I'm not aware of any UI for this, sorry
@Dahlah.FightMe
@Dahlah.FightMe Жыл бұрын
Nice SIr :D
@salim444
@salim444 4 ай бұрын
5:26 there is a command that copy your ssh keys conveniently called ssh-copy-id
@inlophe
@inlophe 2 жыл бұрын
Any reason for still using RSA for SSH key on modern server?
@christianlempa
@christianlempa 2 жыл бұрын
What would you suggest?
@inlophe
@inlophe 2 жыл бұрын
@@christianlempa Using ed25519 if your server update is not older than 5 years old. Sure, RSA 4096 is still good, but it's slow compared to elliptic curves. There is an option to use ed25519 in ssh-keygen, so you don't need to configure anything
@christianlempa
@christianlempa 2 жыл бұрын
@@inlophe last time I checked it wasn't supported on all devices, that’s why I still haven't used it. It might become relevant at some point, but I guess that would be worth a separate video in an unknown future 😊
@andreydoichinov1683
@andreydoichinov1683 4 ай бұрын
Hi Chris, at 8:24 you forgot to tell us what is the string you used.
@christianlempa
@christianlempa 4 ай бұрын
hoho
@swipekonme
@swipekonme 2 жыл бұрын
is there something called very very excellent video
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate!
@Mauricio.Herrera
@Mauricio.Herrera 2 жыл бұрын
Hi, which terminal client are you using?
@christianlempa
@christianlempa 2 жыл бұрын
I'm using Windows Terminal
@HonoraryBreathTaker
@HonoraryBreathTaker 2 жыл бұрын
Is it possible to make a ssh connection available only when VPN is connected to the server?
@christianlempa
@christianlempa 2 жыл бұрын
Yeah, in that case you'd need to change the listening IP address of the SSH server to the internal network, or you could enable the UFW and only allow traffic from the internal network.
@HonoraryBreathTaker
@HonoraryBreathTaker 2 жыл бұрын
@@christianlempa Thank you
@Dahlah.FightMe
@Dahlah.FightMe Жыл бұрын
New Subscriber 129k :D
@m.mukunthan5536
@m.mukunthan5536 2 жыл бұрын
I am waiting for video
@Egimatic
@Egimatic 2 жыл бұрын
What software do you use to open the linux shells
@christianlempa
@christianlempa 2 жыл бұрын
I recently made a video about my entire setup, maybe thats interesting for you: kzfaq.info/get/bejne/paxmmq-qzbeolKs.html
@ricerob
@ricerob Жыл бұрын
How do you lock down the back door built into system d
@BobDschingisKhan
@BobDschingisKhan Жыл бұрын
tell more about it. 🙂🙃
@raughboy188
@raughboy188 Ай бұрын
There are few other things you should add to your strategy of protectiong your servers and network in general. First and foremost youn need to learn OSI layers of network and set up your security on each of the layers. I did mentioned layers didn't I? that's actualy second thing, set up your security as layers because it will help you keep track of attacker as he moves across layers to egt to destination. More layers of protection you have better it is for you because you can catch attacker sooner and respond faster, it will help you with revealing possible vunerabilty because you can see at which layer it happened. most of the time you'll connect to everything within your network for maintenance via ssh right? Yeah in that case change port you're gonna be using for ssh in your network because using default port for it is agains best practices. Now onto vlans. Fragment you network with vlans how ever one of the vlans should be designated as native vlan where everything untagged goes but that can't and shouldn't be vlan 0, also if you have unused prort assign them to unused vlan as security measure, doing what i said with vlans prevents attacker from using vlan hoping attack to get to your data. There are many more attacks but if i keep writing my comment will get too long so i will mention one that can result with DOS across your network and it's dhcp exaustion which happens as a result of dhcp receiving bunch of fake requests for ip to the point where dhcp server runs out of ip's and without ip devices cannot connect to network. There's a lot more you can do.
@christianlempa
@christianlempa Ай бұрын
There’s always something more you can do, but in the end all of these strategies provide a strong foundation to cover 99% of the attacks you’re facing as a homelab dude :)
@raughboy188
@raughboy188 Ай бұрын
@@christianlempa what i said about ssh,vlan and dhcp exhaustion comes from best practices recommended ny cisco systems.
@activenode
@activenode 9 ай бұрын
Good contents, thanks. However it's pronounced "Youboontoo" kinda, not "Youbantoo" :)
@danholli123
@danholli123 2 жыл бұрын
What if I ignore security?
@hpsfresh
@hpsfresh 11 ай бұрын
ssh-copy-id, not scp. it will create remote files and permissions
@rf1890
@rf1890 Жыл бұрын
I don't undertand the the docker chain, Port 9000 Problem. Why does ufw allow 9000?
@christianlempa
@christianlempa Жыл бұрын
That’s coming from the container engine
@rf1890
@rf1890 Жыл бұрын
@@christianlempa yeah, but ufw shouldn't care where it's coming from...
@davidrichard1811
@davidrichard1811 2 жыл бұрын
Vielen Dank Christian Grüsse von Arizona
@christianlempa
@christianlempa 2 жыл бұрын
Hey! Vielen Dank und Grüße zurück :D
@atol71
@atol71 2 жыл бұрын
Besides, system (Milkyway, Universe) is a simulated system inside virtual computer and your PC is a virtual computer inside that virtual computer, so from higher levels of system you can access any way you like the low level virtual computers. Bit like Russian children's toy: Matrychka doll.
@jwbonnett
@jwbonnett 2 жыл бұрын
Can I ask why you are using "scp" to copy the key rather than "ssh-copy-id"?
@christianlempa
@christianlempa 2 жыл бұрын
I'm still used to it ;)
@mebeingme947
@mebeingme947 2 жыл бұрын
As always good video again. Just a little adder....change the port number for ssh from 22 into a non-standard like 24 e.g.. In many cases port 22 is looked for by server hackers. Another thing to check is on your IPS side. Which ports are visible by using a tool like shieldsup! This way you can also determine whether you still have port forwardings open which are no longer needed. If you need portforwardings, where possible use non-linear forwards....e.g. port 65 to port 22...this confuses exploids in many cases. Unfortunately the last one is not always possible. Personally I closed off all ports except for wireguard....second level on the server configured by ufw and 3rd level by fail2ban. I'm not running a webserver other than to accomodate nextcloud instance. I'm fine by doing that over wireguard first to connect.
@christianlempa
@christianlempa 2 жыл бұрын
Thanks mate! Great additions ;)
@patricknelson
@patricknelson 2 жыл бұрын
FWIW, if you just use key-based login and disable user/pass logins, you’re fine. It’s ok for you to change whatever port you want, but for people reading this that think it adds security, it doesn’t (really). It just reduces the likelihood that an automated bot might find your server, but an automated bot isn’t going to brute force your server if there are *zero* possible combinations that could ever possibly work anyway.
@leopard3131
@leopard3131 Жыл бұрын
Another suggestion is to learn iptables. It takes a minute but iptables will do everything you are doing with multiple servers such as fail2ban and VPN. Iptables will also do your routing if you are not running a custom router already.
@ultravioletiris6241
@ultravioletiris6241 Жыл бұрын
You can get a VPN-like effect from using iptables? How ?
@leopard3131
@leopard3131 Жыл бұрын
@@ultravioletiris6241 What is a "VPN" effect? I believe I can certainly replace fail2ban with iptables rules as well as what he is doing in his use case of VPN.
@ultravioletiris6241
@ultravioletiris6241 Жыл бұрын
@@leopard3131 You said that iptables can do everything he is doing with a VPN. Did you literally mean everything, including the VPN tunnel itself? Or did you mean that only some things can be replicated by iptables?
@leopard3131
@leopard3131 Жыл бұрын
@ultraviolet iris What is "everything " ? What are you wanting to do with a VPN? Hide your ip? Adblock? But yes, you can restrict traffic with iptables.
@leopard3131
@leopard3131 Жыл бұрын
@ultraviolet iris I guess when I watched this video and commented yes I felt the tools I mentioned including iptables would accomplish the same goal as the use of VPN although obviously it is a different tool. I am not going to rewatch the video to answer your vague questions but if you have a specific question and the answer is brief I am willing to clarify.
@Exotelis-skydive
@Exotelis-skydive 16 күн бұрын
Just use ssh-copy-id to copy your ssh key. Maybe someone else mentioned this already :)
Don’t run Proxmox without these settings!
25:45
Christian Lempa
Рет қаралды 47 М.
I bought the most MINIMALIST Tech ever.
48:11
Mrwhosetheboss
Рет қаралды 487 М.
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 627 М.
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 16 МЛН
How to open a can? 🤪 lifehack
00:25
Mr.Clabik - Friends
Рет қаралды 13 МЛН
The Biggest Linux Security Mistakes
9:44
Chris Titus Tech
Рет қаралды 141 М.
How Hackers Move Through Networks (with Ligolo)
20:01
John Hammond
Рет қаралды 249 М.
You should NOT use Cloudflare Tunnel (if you do this...)
10:07
Christian Lempa
Рет қаралды 217 М.
new linux exploit is absolutely insane
8:29
Low Level Learning
Рет қаралды 408 М.
The Free and Open Source Software I Use in 2024 - Part 1
28:31
Awesome Open Source
Рет қаралды 116 М.
What's the BEST home server operating system?
17:35
Christian Lempa
Рет қаралды 581 М.
How to start your HomeLab journey?
17:32
Christian Lempa
Рет қаралды 26 М.
Secure authentication for EVERYTHING! // Authentik
39:50
Christian Lempa
Рет қаралды 106 М.
5 Must Have Tweaks to Secure OpenSSH
21:48
Learn Linux TV
Рет қаралды 25 М.
How to create a valid self signed SSL Certificate?
25:01
Christian Lempa
Рет қаралды 329 М.
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 627 М.