Article Tags
How to install Samba on CentOS

How to install Samba on CentOS

Update the system: Use sudodnfupdate-y (CentOS8/Stream) or sudoyumupdate-y (CentOS7) to ensure the system is up to date; 2. Install Samba: Run sudodnfininstallsambasamba-commonsamba-client-y (or yum command) to install core components; 3. Configure sharing: Backup and edit /etc/samba/smb.conf, and add basic sharing settings such as [shared]path=/srv/samba/shared; 4. Set directory permissions: Create a shared directory and set chmod0755, chownno

Jul 24, 2025 am 03:24 AM
How to restart the network service in CentOS?

How to restart the network service in CentOS?

To restart network services in CentOS, you must first confirm the network management method used by the system. 1. Use the ps-ef|grepNetworkManager command to determine whether it is a NetworkManager or a traditional network service; 2. If you use a new version of CentOS (such as CentOS7 or Stream), it is recommended to restart the network service through sudosystemctlrestartNetworkManager or sudosystemctlrestartnetwork; 3. You can use nmcliconnectionreload to reload the configuration without interrupting the service, or execute s for specific connections.

Jul 24, 2025 am 02:11 AM
centos Internet service
How to install Nginx on CentOS

How to install Nginx on CentOS

Update the system: Run sudoyumupdate-y to ensure the system is up to date; 2. Install EPEL source: execute sudoyuminstalllepel-release-y to obtain the Nginx package; 3. Install Nginx: Use sudoyuminstallnginx-y to install the service; 4. Start and enable Nginx: Set up the power-on startup through sudosystemctlstartnginx and sudosystemctlenablenginx, and use sudosystemctlstatusnginx to confirm the running status; 5. Configure the firewall: If firewalld is enabled, run sudofir

Jul 24, 2025 am 02:01 AM
centos nginx
How to partition a new hard drive with fdisk or parted?

How to partition a new hard drive with fdisk or parted?

When partitioning new hard disks, fdisk is suitable for MBR partition tables, and parted is recommended for GPT partition tables; when using fdisk, first use lsblk or fdisk-l to identify the hard disk device, run sudofdisk/dev/sdX to create the main/extended partition, set the start and end sectors and enter w to save and refresh the partition table and then format it; when using parted, run sudoparted/dev/sdX to set it to gpt partition table, use mkpart to create partitions to specify GB or percentage, and format it after exiting; pay attention to partition alignment, type settings and FAT32ESP partition required for UEFI startup.

Jul 24, 2025 am 12:49 AM
Partition fdisk
How to check the status of FirewallD and its rules?

How to check the status of FirewallD and its rules?

To view the status and rules of FirewallD, you can follow the following steps: 1. Use systemctlstatusfirewalld to confirm whether the service is running. If it is not running, you can start sudosystemctlstartfirewalld and set the power on and start it up with enable; 2. View the current area through firewall-cmd-get-active-zones, and use --get-zones to view all areas; 3. Execute firewall-cmd-list-all to view all rules in the current area. Add the --zone parameter to specify the area, and use --list-rich-rules to view rich

Jul 23, 2025 am 03:18 AM
Status check
How to filter journalctl output by a specific service or time?

How to filter journalctl output by a specific service or time?

To filter journalctl logs, view them by service or time range. 1. Filter by service name: use journalctl-u, such as journalctl-unginx.service; if you are not sure of service name, you can find systemctllist-units|grep. 2. Filter by time range: use --since and --until to specify the time, such as journalctl--since"1hourago" or journalctl--since"2025-04-0510:30:00"--until"2025

Jul 23, 2025 am 03:16 AM
How to reset root password in CentOS

How to reset root password in CentOS

Reboot and enter the GRUB menu, press e to edit the startup item; 2. Add init=/bin/bash or rd.break at the end of linux or linux16 line; 3. If you use rd.break, you need to chroot/sysroot first, then mount-oremount,rw/; 4. Execute passwdroot to set a new password; 5. If SELinux is enabled, run touch/.autorelabel; 6. Execute reboot-f to restart to take effect. This method is suitable for CentOS7 and above and requires physical or console access.

Jul 23, 2025 am 02:16 AM
centos root password
How to create a systemd service file

How to create a systemd service file

Create a service file: Create a .myapp.service file in /etc/systemd/system/, set the [Unit], [Service], [Install] sections and configure key parameters such as Description, ExecStart (using absolute path), User, Restart, etc.; 2. Reload and enable the service: execute sudosystemctldaemon-reload, enable, and start to enable the service and set the power-on self-start; 3. Avoid common errors: do not use relative paths, do not run with root, ensure the script permissions are correct, must be overloaded after modification, and finally use sudosystemct

Jul 23, 2025 am 02:01 AM
How to use rsync to efficiently transfer files?

How to use rsync to efficiently transfer files?

Rsync is an efficient and reliable file transfer and synchronization tool. Its basic command structure is rsync[Options] source path and target path, which supports local copying, remote pulling or pushing files. 1. Common options include -a (archive mode), -v (detailed output), and -z (compressed transmission). 2. Use the -essh parameter when performing secure transmission via SSH, and it is recommended to configure the key login to avoid password input. 3. Use --exclude to exclude specific files or directories, such as logs, caches, version control directories, etc., and you can also list multiple exclusions through files. 4. If the transmission is interrupted, you can use --partial to retain the transmitted part and continue from the interruption. Combined with --progress to view the progress. 5. Pay attention

Jul 22, 2025 am 03:29 AM
file transfer rsync
How to secure the SSH server on CentOS?

How to secure the SSH server on CentOS?

To improve SSH service security, you need to modify the default port to disable root login using key authentication and restrict access to the source. 1. Modify the Port value in /etc/ssh/sshd_config and restart the sshd service to avoid automated scanning; 2. Set PermitRootLogin to no and create a normal user with sudo permissions to prevent the leakage of administrator permissions; 3. Use ssh-keygen to generate a key pair and deploy the public key through ssh-copy-id and then close PasswordAuthentication to enhance login security; 4. Only allow specific IPs or network segments to access SSH ports through firewalld settings and deny all other connections to shrink

Jul 22, 2025 am 02:17 AM
How to view the history of yum transactions?

How to view the history of yum transactions?

To view the history of YUM transactions in Linux system, mainly use the yumhistory command. First, run yumhistory to list all YUM transactions, including IDs, operations and timestamps; secondly, use yumhistoryinfo to view the detailed information of a specific transaction; if you need to filter records, you can use yumhistorylist to view only the operations of a certain package, or use yumhistorylistall--since'1weekago' and yumhistorylistall--start-date'2024-03-01'--end-date'2024-03-10' to filter by date range; in addition,

Jul 22, 2025 am 01:39 AM
yum history record
How to list all users on the system?

How to list all users on the system?

The method of listing all users in the Linux system is as follows: 1. Use cat/etc/passwd to view the complete user information; 2. Use cut command to extract only user names: cut-d:-f1/etc/passwd; 3. Use getentpasswd to list users including network services; 4. Use getentpasswd|cut-d:-f1 to obtain the name of the network service user; 5. Use awk to filter UID ≥1000 and non-nobody users to identify ordinary users; 6. Use last|grep "stillloggedin" to check the current active user. These methods are applicable to viewing local users and network

Jul 22, 2025 am 01:18 AM
system user
How to use sestatus and getsebool for SELinux diagnostics?

How to use sestatus and getsebool for SELinux diagnostics?

SELinux permission issues can be troubleshooted through sestatus and getsebool. First, use sestatus to check whether SELinux is enabled and the current mode. If it is enforcing, the program permissions may be restricted; second, use getsebool to check the service-related boolean values, such as whether httpd_enable_homedirs is enabled, setsebool can be temporarily modified; during troubleshooting, you can switch to permissive mode to test whether the problem disappears, and use audit2why to analyze the rejection record in the log, and prioritize adjusting the boolean values or adding policy modules instead of directly turning off SELinux.

Jul 21, 2025 am 04:02 AM
selinux diagnosis
How to disable SELinux permanently?

How to disable SELinux permanently?

To permanently close SELinux, you need to modify the configuration file and restart the system. The specific steps are: 1. Edit the /etc/selinux/config file and change the value of SELINUX= to disabled; 2. Save and exit and restart the system; 3. Use the sestatus or getenforce command to confirm whether the status has changed to disabled. Note that if newer versions such as CentOS8/RHEL8 are missing configuration files, you can manually create soft links or check package management. If you temporarily disable selinux=0 can be added through GRUB, but it is not recommended to use for a long time. It is recommended to switch permissive mode during debugging instead of completely shutting down, because turning off SELinux will weaken system security.

Jul 21, 2025 am 02:52 AM
selinux Disable

Hot tools Tags

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use