Initial CentOS Server Setup: Safe Basics for New Servers

You just spun up a fresh CentOS server and now you’re staring at an IP address thinking, “Okay… now what?”

If you’re running WordPress sites, small business apps, or just tinkering like I do at night after the kids sleep, these first minutes matter. A few basic steps now will make your server safer and easier to live with later.

This guide walks you through the very first CentOS setup basics:
– How to connect to your new server
– How to use the root account safely
– How to create a normal user for day-to-day work

It’s simple stuff, but important.

1. Know What You Need Before Touching the Server

Before you even type a command, make sure you have the essentials ready. Saves a lot of “why won’t this connect?” frustration.

You’ll need:

  • Your server’s public IP address
    This is what you use to connect over SSH. Your provider (DigitalOcean, VPS provider, etc.) will show this in their dashboard.

  • Root login credentials
    You’ll have one of these:

  • A root password, or
  • An SSH key that’s associated with the root account (plus the key’s passphrase if you set one)

If you’re not sure which you have, check the email or control panel from your hosting provider. They usually spell it out.

2. Connect to the Server via SSH as Root

Once you’ve got the IP and credentials, time to log in.

On your local machine (Linux, macOS, or Windows with something like PowerShell or an SSH client), run this command. Replace your_server_ip with the actual IP:

ssh root@your_server_ip

What happens next depends on your setup:

  • First-time connection warning
    SSH will likely say something like:

The authenticity of host ‘your_server_ip’ can’t be established…

Type yes and press Enter. This just saves the server fingerprint locally so SSH can warn you if it changes later.

  • If you’re using a root password
    SSH will ask:

root@your_server_ip's password:

Type the password (you won’t see any characters while typing) and hit Enter.

  • If you’re using an SSH key with a passphrase
    SSH will ask for your key’s passphrase the first time you use it in a session:

Enter passphrase for key '/home/youruser/.ssh/id_rsa':

  • If it’s the first time logging in with a password
    CentOS may ask you to change the root password right away. Follow the prompts and set a strong one. Don’t reuse your Gmail password from 2008.

When the login works, you’ll end up at a shell prompt, something like:

[root@hostname ~]#

That # at the end means you’re root. Which leads us to the important bit…

3. Understand Why Root Is Dangerous (and Necessary)

Root is like God mode.

The root user can:
– Install or remove anything
– Edit any file on the system
– Break everything with one bad command

That power is useful when setting up the server, but it’s also risky. A simple typo like this:

rm -rf / var/www

…instead of:

rm -rf /var/www

can do very different things when you’re root.

Because of that, you shouldn’t use root for daily work. The safer pattern is:

  1. Log in with a regular user
  2. Use elevated privileges only when needed

So the next step is to create a new, normal user and stop using root directly for normal stuff.

4. Create a New User for Day-to-Day Work

You’re still logged in as root at this point. Let’s create a new user account you’ll use from now on.

The official example from the source uses the username sammy. You can keep that or swap in your own name, but I’ll stick with sammy so it’s consistent.

Run this as root:

adduser sammy

This creates a new user with:
– Its own home directory (like /home/sammy)
– Its own files and settings

Next, you need to set a password for this new user:

passwd sammy

You’ll be asked to type the new password twice. Use a strong one; you’re going to be logging in with this user.

Quick recap of this step:
adduser creates the account
passwd gives it a password so you can log in

From here, the idea is: do daily work as sammy, and only jump to root-level power when really needed.

5. Start Logging In as Your New User

Once sammy exists, you don’t have to keep logging in as root.

From your local machine, next time you connect, use:

ssh sammy@your_server_ip

SSH will now:
– Ask for sammy’s password (the one you just set), or
– Use an SSH key, if you’ve configured one for sammy later

You’ll notice the prompt looks a bit different now, for example:

[sammy@hostname ~]$

That $ instead of # means you’re a regular user, not root. Much safer for day-to-day commands, editing project files, and doing basic work.

When you do need root power (like installing packages or changing system config), you’ll normally use something like sudo—but that’s outside the bit covered in the source. The important part here is: you now have a limited user to keep your system safer from accidental damage.

6. Safety Tips While You Work (So You Don’t Nuke the Box)

Even though we’re still early in the setup, a few habits right now will save headaches later.

  • Avoid working as root unless needed
    You’ve already created sammy for this reason. Logging in as a limited user is your first safety layer.

  • Double-check destructive commands
    If a command has rm, mv, or anything touching /, read it twice before hitting Enter.

  • Use a test environment when possible
    If this server will run something important (like your client’s WooCommerce store), consider doing risky experiments on a second VPS or local VM first.

  • Keep login details safe
    Store your root password, sammy password, and any SSH keys securely. Don’t just toss them into a random notes file synced everywhere.

7. What You’ve Done and What’s Next

You’ve just handled the most basic, but important, early steps on a new CentOS server:

  • Gathered the right info: server IP and root access method
  • Connected to the server via SSH as root
  • Understood why root is powerful and risky
  • Created a new user (sammy) for safer, everyday work
  • Started using that normal user instead of living in the root account

With this foundation, you’re in a much better place to continue setting up your stack—whether that’s a LAMP/LEMP setup for WordPress, a small app, or just a practice box for learning.

Need more help? Check the latest CrushEdge posts.

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.