Getting started reddit / selfhosted ---------------------------------------------------------------------- therealtwerkman · 2023-10-07 00:14 Hey everyone, I'm new. I bought a cheap Kumari Mini PC to experiment with a homeserver. Unfortunately it doesn't have AVX Instructions (No MongoDB 5.0) I tried using mongoDB 4.4 as a workaround, to install FileCloud but FileCloud doesn't work without MongoDB 5.0 or newer. I am running Ubuntu Server 22.04. I don't have any specific goals other than learning. But, I would like to get to the point, where I can use services like NextCloud, Twingate or Cloudflared, after getting the SSL Certified and accessing my server remotely through a domain name but I'm having some issues. ​ First issue, I have disabled PasswordAuthentication in 2 different files in order just to use Pub/Priv Key auth, but it still allows for PasswordAuthentication. I probably want to add another private key to another device anyways, before completely disabling PasswordAuth, but need guidance from someone way smarter than me as to why PasswordAuth is still enabled. ​ I've set some firewall settings with UFW, installed ClamAV, Snort, etc...for basic security. But when trying to change the port the server listens on through sshd\_config file, it still defaults to port 22. Possibly related to issue above, not sure. But know I'd have to change Firewall settings accordingly to whichever port I use. ​ I'm having some issues with Apache2, here's the error I'm getting, "\[Sat Oct 07 00:02:10.561453 2023\] \[core:warn\] \[pid 37943\] AH00111: Config variable ${APACHE\_RUN\_DIR} is not defined apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot" and am currently troubleshooting as we speak. ​ As you can tell, I'm quite a few steps away from knowing wtf I'm doing. But I figured I could come to this community, to find a member with enough experience, that would possibly be willing to help me troubleshoot a few issues, to help me learn and understand what's not working and how to get it working, and how to actually get me to the phase where I'm connecting to my server remotely through a domain. ​ If no one can help, no biggie, but will take much more time, and I'm starting to give up. Please help, I don't want to go to windows server -\_\_\_\_- ---------------------------------------------------------------------- NikStalwart · 2023-10-07 00:31 > First issue, I have disabled PasswordAuthentication in 2 different files in order just to use Pub/Priv Key auth, but it still allows for PasswordAuthentication. I probably want to add another private key to another device anyways, before completely disabling PasswordAuth, but need guidance from someone way smarter than me as to why PasswordAuth is still enabled. I'm assuming you are talking about ssh here. Did you reload sshd after you edited the configs? If you just edited the files, nothing will happen. > I also would want advice on how to encrypt one file (my private key) on each device, in order to better protect my server's private key. That's not *quite* how this works. You can set a private key passphrase on your public key when you generate it. Read the man page for ssh-keygen. You cannot encrypt the server-side private key though, because, being a server, there's nobody to decrypt it for yo uto be able to log in. straightforward guides on basic administration tasks. > I've set some firewall settings with UFW, installed ClamAV, Snort, etc...for basic security. But when trying to change the port the server listens on through sshd_config file, it still defaults to port 22. Possibly related to issue above, not sure. But know I'd have to change Firewall settings accordingly to whichever port I use. Yeah this tells me you didn't reload sshd. Also, you really don't need "ClamAV, Snort, etc...for basic security". The more applications you run, the more security issues you will have. There is no need to install unnecessary software (with the potential to misconfigure it and break something else). Only start adding tools when you need to. ClamAV is primarily used for mail servers (and, potentially, file servers). But, if you are the *only* person using the server, it is redundant. Linux is not Windows, viruses do not just install themselves, and if you sudo install-virus.sh, then no AV is going to stop you. > I'm having some issues with Apache2, here's the error I'm getting, "[Sat Oct 07 00:02:10.561453 2023] [core:warn] [pid 37943] AH00111: Config variable ${APACHE_RUN_DIR} is not defined Firstly, don't use Apache. Secondly, if you do use Apache and you don't know what you are doing, read DigitalOcean's guide on [installing a LAMP stack](https://www.digitalocean.com/community/tutorials/how-to- install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04) should be good. It is a little out of date (Ubuntu 18.04) but you should still be able to follow it with recent distros. Nothing catastrophic has changed. ---------------------------------------------------------------------- therealtwerkman · 2023-10-12 01:38 I did reload ssh, I also found another file overwriting the sshd\_config file "50-cloud-init" and commented out password auth for that. I meant to encrypt just the private key file on my device, but you are right, I didn't think about the fact that the server wouldn't be able to decrypt the file. Thank you, but, since I have reloaded SSH, I don't know why PasswordAuth is still working.