linux:admin
Differences
This shows you the differences between two versions of the page.
| linux:admin [2016/01/20 04:18] – [check netword card] admin | linux:admin [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| {{: | {{: | ||
| - | ===== install | + | ===== Fix Old CentOS Repos ===== |
| - | ==== install | + | Maintainece update not supported from **2020/ |
| + | <code bash> | ||
| + | yum list | ||
| + | Failed to set locale, defaulting to C | ||
| + | Loaded plugins: fastestmirror | ||
| + | Determining fastest mirrors | ||
| + | YumRepo Error: All mirror URLs are not using ftp, http[s] or file. | ||
| + | Eg. Invalid release/ | ||
| + | removing mirrorlist with no valid mirrors: / | ||
| + | </ | ||
| + | |||
| + | Steps: | ||
| + | - Step1: **Update / | ||
| + | <code bash> | ||
| + | [base] | ||
| + | name=CentOS-$releasever - Base | ||
| + | # | ||
| + | baseurl=http:// | ||
| + | gpgcheck=1 | ||
| + | gpgkey=file:/// | ||
| + | #released updates
[updates]
name=CentOS-$releasever - Updates
# | ||
| + | #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# | ||
| + | #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
# | ||
| + | #contrib - packages by Centos Users | ||
| + | [contrib] | ||
| + | name=CentOS-$releasever - Contrib | ||
| + | # | ||
| + | baseurl=http:// | ||
| + | gpgcheck=1 | ||
| + | enabled=0 | ||
| + | gpgkey=file:/// | ||
| + | </ | ||
| + | - Step2:< | ||
| + | yum clean all | ||
| + | </ | ||
| + | ===== Install | ||
| + | ==== Install | ||
| mount /dev/cdrom /mnt/cdrom/ | mount /dev/cdrom /mnt/cdrom/ | ||
| cd / | cd / | ||
| Line 102: | Line 138: | ||
| * Remove user and home directory itself and the user´s mail spool. <code bash> | * Remove user and home directory itself and the user´s mail spool. <code bash> | ||
| userdel -r anhvc | userdel -r anhvc | ||
| + | </ | ||
| + | * Add System User:< | ||
| + | #Create User and not create Home Directory | ||
| + | useradd -M dovecot | ||
| + | #Lock User not allow login | ||
| + | usermod -L dovecot | ||
| </ | </ | ||
| ==== Admin group ==== | ==== Admin group ==== | ||
| Line 272: | Line 314: | ||
| gateway 123.30.133.129 | gateway 123.30.133.129 | ||
| netmask 255.255.255.128 | netmask 255.255.255.128 | ||
| - | network 123.30.133.128 | + | network 123.30.133.128#custom |
| - | broadcast 123.30.133.255 | + | broadcast 123.30.133.255#custom |
| </ | </ | ||
| / | / | ||
| </ | </ | ||
| - | ==== Check netword | + | ==== Check network |
| <code bash> | <code bash> | ||
| / | / | ||
| Line 312: | Line 354: | ||
| </ | </ | ||
| === Dynamic route === | === Dynamic route === | ||
| - | Redhat: update route in / | + | * Redhat: update route in / |
| cat > / | cat > / | ||
| - | |||
| 10.199.44.0/ | 10.199.44.0/ | ||
| 10.199.51.5/ | 10.199.51.5/ | ||
| Line 326: | Line 367: | ||
| echo ' | echo ' | ||
| route add -host 10.30.15.16 gw 10.30.31.1 | route add -host 10.30.15.16 gw 10.30.31.1 | ||
| + | </ | ||
| + | / | ||
| + | </ | ||
| + | * Debian: Edit **/ | ||
| + | up route add -net 10.8.0.0 netmask 255.255.255.0 gw 192.168.1.11 | ||
| + | down route del -net 10.8.0.0 netmask 255.255.255.0 gw 192.168.1.11 | ||
| + | </ | ||
| + | / | ||
| </ | </ | ||
| ==== DNS ==== | ==== DNS ==== | ||
| Line 407: | Line 456: | ||
| === crontab configuration file base on linux user === | === crontab configuration file base on linux user === | ||
| * cat / | * cat / | ||
| - | */30 * * * * / | + | */30 * * * * / |
| */5 * * * * / | */5 * * * * / | ||
| 14 2 * * * / | 14 2 * * * / | ||
| Line 444: | Line 493: | ||
| ls / | ls / | ||
| => 214501_170809.txt | => 214501_170809.txt | ||
| + | </ | ||
| + | === Create contab to update date/time of system === | ||
| + | - Step1: Install ntpdate< | ||
| + | yum install ntpdate | ||
| + | </ | ||
| + | - Step2: Create contab content:< | ||
| + | */30 * * * * / | ||
| </ | </ | ||
| ==== logrotate ==== | ==== logrotate ==== | ||
| Line 539: | Line 595: | ||
| </ | </ | ||
| ==== Increase number open files / | ==== Increase number open files / | ||
| - | Check number open files< | + | Check number open files |
| - | cat / | + | * Method1: |
| </ | </ | ||
| 960 | 960 | ||
| + | </ | ||
| + | * Method2: Check sysctl< | ||
| + | sysctl -a | grep file-max | ||
| + | </ | ||
| + | fs.file-max = 65536 | ||
| </ | </ | ||
| - | Steps to config: | + | Steps to config |
| - Step1: Edit config in / | - Step1: Edit config in / | ||
| fs.file-max = 65536 | fs.file-max = 65536 | ||
linux/admin.1453263538.txt.gz · Last modified: (external edit)
