Debian 서버 운영

Debian is a popular Linux distribution known for its stability and reliable performance. In this blog post, we will explore some essential tips and useful bash commands for effectively operating a Debian server.

1. Updating the System

Keeping your Debian server up to date is crucial for security and performance enhancements. To update the system, run the following commands:

sudo apt update
sudo apt upgrade

The apt update command refreshes the package lists, while apt upgrade installs any available updates.

2. Installing Packages

Debian provides a vast repository of software packages through its package manager, apt. To install a package, you can use the apt install command followed by the package name. For example, to install the Apache web server, run:

sudo apt install apache2

3. Managing Services

To start, stop, or restart system services in Debian, you can use the systemctl command. For instance, to start the Apache service, run:

sudo systemctl start apache2

To stop and restart the service, replace start with stop and restart respectively. You can also enable a service to start on system boot using the enable option:

sudo systemctl enable apache2

4. Firewall Configuration

Securing your server is essential, and Debian comes with the ufw (Uncomplicated Firewall) package for managing firewalls. To enable the firewall, run:

sudo ufw enable

You can also configure specific rules to allow or deny incoming and outgoing traffic. For example, to allow SSH connections, use:

sudo ufw allow ssh

5. Checking System Resources

Monitoring system resources is crucial for server performance. The htop command provides a real-time overview of CPU, memory, and network usage. Install it using:

sudo apt install htop

Then, run htop to launch the tool and explore the various system resource metrics.

6. Managing Users and Permissions

In Debian, you can add, remove, and manage user accounts using the adduser and deluser commands. For example, to add a new user, run:

sudo adduser username

To grant administrative privileges to a user, add them to the sudo group:

sudo usermod -aG sudo username

To change the permissions of a file or directory, use the chmod command. For instance, to give read, write, and execute permissions to the owner, and only read permissions to others, run:

chmod 755 file_name

Conclusion

Operating a Debian server using bash commands allows for efficient system administration. By following the tips and utilizing the commands provided in this blog post, you can effectively manage and maintain your Debian server. Stay updated, secure, and optimized to ensure the smooth functioning of your server.