Notes On Installing CentOS 7 Server
I’ve been on a fedora kick lately, and naturally for my server needs I am using CentOS 7. I have never really used CentOS in production and there are a couple of gotchas that I ran into while getting everything set up that I wanted to jot down for future reference and also in case its useful to someone else.
Install Some Useful Packages
The default install of CentOS is pretty bare bones. I installed several packages to make it a bit more usable.
sudo yum install wget unzip git htop vim epel-release
I tried to get away without installing epel[3], but it’s too darn useful.
Enable SSH Login
I have no idea how or why this works (I think it might have something to do with SELinux), but in order to be able to SSH into your server you need to set up your authorized keys file like this[1]:
mkdir .ssh
chmod 755 .ssh/
# copy your id_rsa.pub file to .ssh/authorized_keys
# you can do this with a text editor, or if its on github
# download it with wget https://github.com/$USER.keys and
# rename it to be the .ssh/authorized_keys file
chmod 600 .ssh/authorized_keys
sudo restorecon -R -v .ssh
After that be sure to set PasswordAuthentication no
in /etc/ssh/sshd_config
and restart the sshd service for this to take effect. sudo systemctl restart sshd.service
.
Install Docker
I used a convenience script from the main docker docs [2], I also added myself to the docker user group in order be able to run docker commands without root.
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
I am not using the root user to log in, I am using my own user.
If you want to use docker-compose, then (assuming you installed epel-release
) you should install pip and docker-compose.
sudo yum install python34-pip
sudo pip3 install docker-compose
Allow outside connections
CentOS uses firewalld[4], it is a bit more complex than what I am used to with UFW, but certainly easier to use than iptables.
You can allow traffic on http and https with the following commands.
sudo firewall-cmd --zone=public --add-service=http
sudo firewall-cmd --zone=public --add-service=https
References [1]Creating .ssh folder [2]Install Docker on CentOS [3]Extra Packages for Enterprise Linux [4]DO firewalld guide
Thank you for reading! Share your thoughts with me on mastodon or via email.
Check out some more stuff to read down below.
Most popular posts this month
- Dagger Feels Like Magic
- Setting up ANTLR4 on Windows
- SQLite DB Migrations with PRAGMA user_version
- 20 Years of Ubuntu
- видно по глазам - you can see it in the eyes
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Serendipity from Armin Ronacher's Thoughts and Writings
- Andrea Veri: GNOME Infrastructure migration to AWS from Planet GNOME
- A Whale of a Time from https://popagandhi.com/
- Pluralistic: You should be using an RSS reader (16 Oct 2024) from Pluralistic: Daily links from Cory Doctorow
- Sahil Dhiman: 25, A Quarter of a Century Later from Planet Debian
- Reflections on Palantir from Nabeel S. Qureshi
- Reading Old Posts from Kev Quirk
- Capture less than you create from David Heinemeier Hansson
Articles from blogs I follow around the net
Script Doctoring
I’ve been having a number of communications problems in my interactions with my doctors at Kaiser lately, and it’s becoming one of those things where the burden and onus entirely is placed upon me to sort out, and that’s exhausting for the actually autist…
via Bix Dot Blog October 22, 2024Blockchain company Forte acquires games studios, demands secrecy, shuts them down
Sometime in 2023, blockchain firm Forte acquired game studios Phoenix Labs and Rumble Games. However, it would be a year before this came to light, because according to a report from Game Developer, Forte demanded secrecy from employ…
via Web3 is Going Just Great October 22, 2024Initial explorations of Anthropic's new Computer Use capability
Two big announcements from Anthropic today: a new Claude 3.5 Sonnet model and a new API mode that they are calling computer use. (They also pre-announced Haiku 3.5, but that's not available yet so I'm ignoring it until I can try it out myself.) Comp…
via Simon Willison's Weblog: Entries October 22, 2024Generated by openring