DEV Community

Victor Kituku
Victor Kituku

Posted on

Getting Started with Linux Server Management

Today I learned some of the fundamental skills needed to manage a Linux server. These are core concepts that anyone working with servers, DevOps, or backend systems should understand. Below is a summary of what I learned, with explanations and examples.


1. SSH into a Linux Server as Root

SSH (Secure Shell) allows you to securely connect to a remote Linux server.

ssh root@server_ip_address
Enter fullscreen mode Exit fullscreen mode
  • root is the superuser with full system access
  • server_ip_address is the public or private IP of the server
  • You may be prompted for a password or use an SSH key

⚠️ Note: Logging in as root is powerful but risky. Best practice is to create a regular user and use sudo instead.


2. Creating a New User

To create a new user:

adduser username
Enter fullscreen mode Exit fullscreen mode

This command:

  • Creates a home directory
  • Sets up default permissions
  • Prompts you to set a password

Example:

adduser victor
Enter fullscreen mode Exit fullscreen mode

3. Switching Between Users

To switch from root to another user:

su - username
Enter fullscreen mode Exit fullscreen mode

Example:

su - victor
Enter fullscreen mode Exit fullscreen mode

The - ensures the user’s environment variables are loaded properly.


4. Navigating the File System

Linux uses a hierarchical file system. Some essential navigation commands:

Check current directory

pwd
Enter fullscreen mode Exit fullscreen mode

List files and folders

ls
ls -la
Enter fullscreen mode Exit fullscreen mode

Change directory

cd /path/to/directory
cd ..
cd ~
Enter fullscreen mode Exit fullscreen mode

5. Copying Files and Directories

Copy a file

cp source_file destination
Enter fullscreen mode Exit fullscreen mode

Copy a directory

cp -r source_directory destination
Enter fullscreen mode Exit fullscreen mode

Example:

cp config.txt /etc/myapp/
Enter fullscreen mode Exit fullscreen mode

6. Moving and Renaming Files

The mv command is used for both moving and renaming.

Move a file

mv file.txt /new/location/
Enter fullscreen mode Exit fullscreen mode

Rename a file

mv oldname.txt newname.txt
Enter fullscreen mode Exit fullscreen mode

7. Editing Files with Nano

Nano is a beginner-friendly terminal text editor.

nano filename
Enter fullscreen mode Exit fullscreen mode

Useful Nano shortcuts:

  • CTRL + O → Save file
  • CTRL + X → Exit
  • CTRL + K → Cut line
  • CTRL + U → Paste line

Nano is great for quick edits to config files.


8. Granting Sudo Privileges

To allow a user to run administrative commands, add them to the sudo group.

usermod -aG sudo username
Enter fullscreen mode Exit fullscreen mode

Example:

usermod -aG sudo victor
Enter fullscreen mode Exit fullscreen mode

To apply changes immediately, log out and log back in.

Test sudo access:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

9. Deleting a User

Delete a user (keep home directory)

deluser username
Enter fullscreen mode Exit fullscreen mode

Delete a user and their home directory

deluser --remove-home username
Enter fullscreen mode Exit fullscreen mode

⚠️ Be careful — this action is irreversible.


10. Why This Matters

These skills are foundational for:

  • Managing cloud servers
  • Deploying applications
  • Securing production environments
  • Working with Docker, CI/CD, and automation tools

Understanding users, permissions, and file management is essential before moving into advanced Linux or DevOps topics.


Final Thoughts

Today’s learning covered:

  • Secure server access via SSH
  • User creation and management
  • Linux file system navigation
  • File operations (copy, move, edit)
  • Permission control using sudo

This is the groundwork for becoming comfortable and confident on any Linux server. 💪🐧


Top comments (0)