Secure Linux Server Setup for DevOps Teams

You’re setting up a production server. You need a way for your team to deploy code, but you can’t give everyone root access and you shouldn't use your personal account for services. This is the moment every DevOps engineer needs a solid permission strategy. Here’s exactly what you do: Step 1: Create a dedicated deploy user. Use useradd -m to give it a home directory, but never use it for manual logins. Step 2: Setup a webteam group. Add the deploy user and your account using usermod -aG. Warning: Forget the -a and you’ll strip your user of all other groups. Step 3: Set ownership & permissions. Assign the app folder to deploy:webteam and set it to 775. Now the group can collaborate safely. Step 4: The Session Refresh. If you get "Permission Denied" after adding the group, run newgrp webteam. This updates your permissions instantly without logging out. Step 5: Lock the shell. Change the deploy user's shell to /usr/sbin/nologin. It can own files and run services, but nobody can SSH in directly. This is what a secure, professional server environment actually looks like. What’s your go-to move for locking down service accounts? 🔗 #Linux #DevOps #Security

  • text

To view or add a comment, sign in

Explore content categories