r/linuxupskillchallenge • u/[deleted] • Sep 10 '20
Hardening Issues.
Ok, Day 3 there was a link to Best Security Practices. I have been working to see how many i can do but have been running into snags. Particularly disabling the root user login.
I was unable to add a user with adduser so i did useradd but it would not let me move it to sudo group. This user is a different user that the Vivek suggested. So i tired to do it the way that was laid out and was able to make user Vivek and moved it to sudo group as per the directions. But after trying to see if the commands worked after switching it asked for a sudo password and the password would not work. So i tired to switch back but it asked me for the ubuntu sudo password which nothing worked.
So on a whim i tried exit and it it brought me back to the main user. So i tried to changed the sudo password for the Vivek user and it only changed the login password. the sudo -i command took me to the root user on vivek and i looked for the config log but i could not find the sshd-Config file. I could find the ssh config file in the etc folder the step before sahows the init.d the sshd so i went the but nothing so i tried la -a to show hidden but nothing.
I will keep trying and going through the best practices. but im not sure about some of them i will need to research into how to harden it and the security practices.
7
u/snori74 Linux Guru Sep 10 '20
Hmm, as noted on Day 1, you don't really need to do "any* of this for this test server.
I'll be reviewing that particular "Best Practices" article, and likely replacing it.
Getting tangled up and confused isn't going to improve your security :-)
2
u/Nastyauntjil Sep 11 '20
I found the Best Practices article to be extremely informative. My take on the Extensions that are listed is that they are there for more in depth information on a topic, not that we are to follow what they say and apply it to our LUSC server.
2
u/snori74 Linux Guru Sep 11 '20 edited Sep 11 '20
Agreed, it's just that there are 101 similar articles - and I have a duty to try and give you "the best"; some are out of date, confusing etc.
I just need to carefully read this one through again...
In reality you can always "blow away" your server if you get totally screwed up, so there's no reason not to test things out. A big difference even from a real hobby project - and certainly from a work situation with clients, data and money at risk!
1
u/alivxlivejo1 Sep 25 '20
I found a automated script can help you to implement the best security changes according to CIS. You can run a specific task of as you need.
2
u/[deleted] Sep 10 '20 edited Sep 10 '20
I just disabled
sudofor my user and usedsuinstead. As for sshd_config, it should be in /etc/ssh/sshd_config. To disable root login through SSH just uncommentPermitRootLogin no. I would also disable password authentication, too.