If you’ve just spun up a fresh Rocky Linux 9 server and you’re staring at the IP address thinking “Okay… now what?”, you’re in the right place.
This guide is for anyone who has a new Rocky Linux 9 box and wants to get the basic, safe first steps done: logging in, using root properly, and creating a normal user to work with.
I’ll keep things practical and short, so you can get to the real work (like hosting your projects or sites) without drama.
1. What You Need Before Touching the Server
Before you try to log in, make sure you have these ready:
- Your server’s public IP address
- The root password, or
- Your SSH private key if you set up SSH key authentication for root
You’ll be connecting over SSH from your local machine. On Linux, macOS, or WSL on Windows, you’ll use the ssh command in the terminal.
If you installed an SSH key with a passphrase, have that passphrase handy too. You’ll likely be asked for it the first time you use the key each session.
2. Log In as root via SSH
First step: get into the server as root so you can do the initial setup.
In your local terminal, run:
ssh root@your_server_ip
Replace your_server_ip with the actual IP address of your Rocky Linux server.
What you’ll see next:
- Host authenticity warning
The first time you connect, SSH will probably show something like:
The authenticity of host ‘your_server_ip’ can’t be established…
Type yes and press Enter. SSH will remember this server in your known_hosts file.
- Authentication
- If you’re using a password: you’ll be prompted for the root password. Type it (you won’t see characters) and press Enter.
-
If you’re using an SSH key: if your key has a passphrase, you’ll be prompted to enter it the first time.
-
Possible forced password change
If this is your first login with a temporary or auto-generated password, the system may ask you to change the root password immediately. Follow the prompts and choose a strong one.
Once you’re in, you’ll be at a shell prompt as root on your Rocky Linux 9 server.
3. Why You Should Avoid Staying as root
On Linux, root is the boss. It can do anything: install packages, change any file, kill any process, destroy the system completely with one bad command.
That power is useful, but also dangerous. A mistyped command as root can break your server beyond easy repair.
That’s why it’s strongly recommended not to use root for normal, day-to-day work. Instead, you:
- Log in once as
root, - Create a regular user,
- Use that user for normal tasks,
- Temporarily escalate privileges only when you really need them.
This keeps accidents smaller and makes your server a little safer in general.
4. Create a Normal User for Everyday Work
Once you’re logged in as root, your next job is to create a new user account you’ll use from now on.
The source example calls the user sam, so let’s stick with that style. You can change sam to whatever username you prefer.
Run this as root:
# Example: create a user named sam
useradd sam
What this does:
- Creates a new user account,
- Sets up a home directory under something like
/home/sam(depending on defaults), - Prepares that account so you can log in as that user later.
Now set a password for this new user so you can log in if needed with password authentication:
passwd sam
You’ll be asked to type a new password and confirm it. Use something strong and not reused from elsewhere.
Safety tip: Even if you plan to use SSH keys later, setting a password now gives you a backup method if key auth isn’t ready yet.
5. Start Logging In as Your New User
From this point on, the idea is: log in as your new user instead of root.
Exit from the current root session:
exit
Then from your local machine, try logging in as the new user:
ssh sam@your_server_ip
- If your server is currently allowing password logins for non-root users, you’ll be prompted for
sam’s password. - If you have SSH keys configured specifically for
sam, you’d use those instead.
Once you’re in as sam, you’ll see a shell prompt without root’s # sign. You’re now working as a regular user with limited power.
If you later need to do something that requires higher privileges, you can use tools like sudo (once configured) from this user, instead of staying logged in directly as root all the time.
6. Basic Workflow After Initial Setup
After you’ve completed this initial setup, your daily routine usually looks like this:
-
SSH into the server as your regular user, not root:
bash
ssh sam@your_server_ip -
Only become root or use elevated privileges when you really need to, for example to:
- Install or remove packages
- Change system-wide configs
-
Manage other users
-
Stay as the regular user for everything else: editing project files, running applications, checking logs, etc.
This keeps your server usable and reduces the chance of catastrophic mistakes.
7. Quick Recap and Next Step
You’ve just done the essential first steps on a new Rocky Linux 9 server:
- Connected over SSH using
ssh root@your_server_ip - Accepted the host authenticity warning on first connect
- Logged in as root using either a password or SSH key
- Created a safer day-to-day user (like
sam) and set a password - Logged back in as that normal user for regular work
From here, you’re ready to continue hardening the box, installing software, or setting up whatever stack you need.
If this worked for you, keep CrushEdge handy for the next fix.
No Comments