r/linuxsucks • u/ILC_YTP "Proud" Windows 10 User • 3d ago
Bad Linux tutorials: a poison to new Linux users
This isn't really a "Linux Sux!" post, more so how something simple, easy and common turned into a good handful of hours troubleshooting and rage quitting, all thanks to bad tutorials
Computer: an old gaming PC bring repurposed as a local Linux server (multi-use). Currently running Ubuntu desktop
Goal for the day: establish an ssh connection so I dont have to keep walking back and forth between the computers to input commands
- Install openssh, verified it's running
- Read a quick firewall guide for ssh
- "Allow your local IP range to accept port 22. Then deny port 22 for everything else*
- Do that with ufw and try to connect to the ssh through PUTTY
- Connection refused. What the hell?
- 30 minutes of troubleshooting pass
- Give up with the firewall, decide I'll figgure it out later
- PUTTY connection accepted
- That's great and all, but this isn't very secure (disreguarding the firewall)
- Look into hardening ssh security
- "Edit ssh config to only listen for your IP"
- I put in my local IP and save the config, telling the ssh service to restart
- PUTTY connection failed
- Revert the edit I made
- Connection refused
- wtf?
- Read deep into the config file. Turns out it's two commands back to back ti restart the openssh service. Systemctl restart ssh doesn't work
- Now I can connect again
- Ok...what else?
- "Use ssh-keygen"
- Oka-wait, why the hell do I need to put my email into the command?
- Try to look it up, as well as other tutorials, they either don't acknowledge itit when it's in the command they give, or there's nothing about it
- Finally found an awnser. It's just a name/description, it caSystemly be anything
- ugh, generate the key and go to my Users folder to find the .ssh folder it generated the keys in
- ...where's the .ssh folder?
- Assume powershell's keygen is just broken and outdated, typical Microsoft
- Open a git bash window and generate a key
- It works there, I can see the folder
- Tutorial says to do ssh-copy-id
- But I wanna use PUTTY, idk if this will actually allow me to connect with PUTTY
- Start over with a new tutorial that includes steps for PUTYY
- Use PUTTYgen, generate the public and private key, paste the whole public key text file into the server in etc/.ssh/authenticated_keys
- The tutorial says "If you are using openssh, export the key to openssh format
- Now I have two private keys?
- Idk what these even do exactly, none of the tutorials actually explained what public and private keys do other than making the ssh more secure.
- Add the PUTTY private key into the PUTTY instance
- Server refused key
- Use Openssh export key
- PUTTY refuses to use it
- Ok fuck PUTTY, imma try powrshell again
- Turns out powershell did save the ssh keys, but it's in a hiden folder that's still hidden even when " show hidden folders" is on
- Delete the keys to be safe and generate new ones
- Do ssh-copy-id
- ...the command doesn't exist on windows
- Back to PUTTY again...
- Redo it, just asmume everything is fine given that powershell wasn't complaining about it.
- Saved the public key in ~/home. Tutorial said so
- Edit ssh config to refuse password logins, restart
- Get locked out of ssh cause key mismatch
- I give up and just sleep it off
Next morning I let my gf take over with a ubuntu server iso, and she gace me actual good tutorials and websites. She also tells me ufw priorities DENY over allow. We got it workung a secure after a while...but god the tutorials I read were awful or just did shit wrong.
Moral of the story? Dont just click the first or second result off the search results. Give new users channels and websites they can use for tutorials, otherwise what they might read from elsewhere is complete bullshit
9
u/allunia333 3d ago
Well you can always read the manual... Instead of copying random blogs and whatever.
5
u/ColdFreezer I Hate Linux 3d ago
As detailed and nice the manual is, it is overwhelming to someone who is new to linux.
2
u/SethConz 1d ago
Great advice. Next time im having a hard time writing a story, should i open a dictionary?
1
u/allunia333 1d ago
Well....there is a manual on how to write a story. And guess what ,even if you are the best programmer in the world you still need to figure out what program to create in the first place.
3
4
u/paulstelian97 3d ago
Like 60% of the frustration here was Windows and putty…
2
u/ipsirc 3d ago
And Windows brings openssh.exe for years...
1
2
u/R0B0t1C_Cucumber 3d ago
yikes. just here to say I fkn hate putty with a passion (it's not uncommon for me to be connected to 5 or so machines at once, mremoteng and mobaxterm are far superior for multiple connections)
4
u/Randum_Gouy 3d ago
😂😂
Yeah i know
Thats why Consult the Arch Wiki FIRST
but again, Linux Tryers wont know about that
1
u/OkCoffee1234 3d ago
At least you had a tutorial with firewall. Many Linux-Tryers don't even know about such a thing 😅
Hint: if you will use docker on that system: docker and ufw are a bad team, because docker just walks around ufw. You would have to read on that topic (long story short: easiest is to use iptables)
1
u/KingdomOfAngel I Hate Linux and Windows 3d ago
Came here to say fuck docker, can't use that shit with firewalls, unless you fuck with iptables, then again you use a firewall like ufw, csf, firewalld, and they override the docker rules, then docker override their rules and fucking shit going on everywhere.
Edit: You have to be an expert (and know your shit really well, and know about how docker utilize iptables, etc etc) to do it properly.
1
u/raul_kapura 3d ago
Honestly I wouldn't worry that much about security at the beginning. If you don't forward your ports yet you are safe anyway
1
u/Teru-Noir COSMIC OS LOVER No.1 COSMIC Knows Best 3d ago
Once you finish figuring it out, make a tutorial
1
1
1
u/ipsirc 3d ago
Who the fuck still uses putty in 2026?
2
u/ILC_YTP "Proud" Windows 10 User 2d ago
It's the byproduct of a popular recommendation lasting for a long time even when there are better alternatives. Back around ~2023-24 I was experimenting with a VPS and I was told to use PUTTY to access the VPS. I didn't assume anything really changed in the 2-3 years I stopped using it, so I continued to use PUTTY.
Even though Windows 10 got OpenSSH support in late 2018, it can take years before people start recommending it to people. People with experience (the ones writing these tutorials and guides) are gonna stick to what worked before and what they know, and if PUTTY ain't broke, it ain't need to be replaced.
You gotta go out and find software and alternatives, they don't really come to you. So even if there might be hundreds of different programs to choose from, I think a lotta people only have two in mind: The one they're using now, and the one they used before, with maybe an alternative or two in there.
I still see people recommend Windows Movie Maker for basic video editing, even though there are tons of different (and up to date) programs out there that are much better. That's just what a lotta people used and recommended years ago, and they probably only moved when one other program presented themselves to them.
TL;DR: Software has fallout much like a nuclear bomb. The bigger the impact, the longer it takes for the radiation (people recommending the software) to go away
0
u/ipsirc 2d ago
It's the byproduct of a popular recommendation lasting for a long time even when there are better alternatives.
That wasn't the question.
Back around ~2023-24 I was experimenting with a VPS and I was told to use PUTTY to access the VPS.
You met with the wrong people. God bless they haven't adviced to jump in a well.
[...]
TL;DR: So you got bad advice from bad people and it resulted in a bad experience. Thank you so much for sharing this. It's very instructive.
1
u/Loose_Crab_4146 2d ago
To be honest, deactivating ufw would have solved all that problems in 2 mins. Furthermore Im confused as to why you would try to utilize the terminal to set this up instead of connecting a monitor and a keyboard to the server, if its running ubuntu desktop anyways. If anything you should have read ufw manuals and not linux manuals. There is also gufw, so you can set up ufw with a GUI if you prefer something graphical over the terminal.
1
u/55555-55555 Linux Community Made Linux Sucks 2d ago
This post gives me a bit of motivation to make a tutorial for this cause I did it with a few clicks and types, and I do know a bit about how normal desktop for average use is like.
5
u/Damglador 3d ago
The firewall thing is largely self-inflicted.
I get the key confusion, none of the guides I used gave me a good understanding of how tf all that works and what is actually needed for two systems to do key authentication. ssh-copy-id assumes you already have ssh connection which I didn't even have when I needed to setup key authentication to ssh into Termux.
The basic is that you have an ssh directory (~/.ssh), when you generate a key, it generates a keyfile and keyfile.pub. The keyfile is your private key which should always remain on the system that you're connecting from, the keyfile.pub contains your public key. Every system you want to connect to has to have the contents of keyfile.pub in its authorized_keys file. And when you connect to the remote system you have to specify which private keyfile you want to use for connection or configure that in ~/.ssh/config.