Created
March 29, 2020 10:26
-
-
Save covelus/49eb9f08243c3327a7ca7b42f7796bb9 to your computer and use it in GitHub Desktop.
GNU/Linux, basic SysAdmin summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PROCESOS INICIO / SysVinit: | |
| [Runlevels S,s,0..6: S=s=1: monousuario; 0: apagado; 2: multiusuario sen NFS, login texto; 3: multiusuario 2 + NFS + rede; 4: -; 5: multiusuario 3 + X; 6: reinicio] | |
| - runlevel | |
| - /sbin/telinit <runlevel> | |
| - /etc/inittab | |
| - /etc/rc.d --> /etc | |
| - /etc/rc.local | |
| - /etc/init.d | |
| - chkconfig [--list | <service> [on | off | stop | start] # runlevels e servizos | |
| - service [--status-all | <name> [status | start | stop | ...] # servizos inicio | |
| PROCESOS INICIO / systemd: | |
| - systemctl [opt] <command> [name] | |
| - systemctl list-units -t service --all # tódolos servizos | |
| - systemctl list-units -t service # servizos activos | |
| - sudo systemctl start <service-name> | |
| - sudo systemctl start <service-name.service> | |
| - sudo systemctl start <service-name | service-path-name.service> | |
| - sudo systemctl stop <service-name> | |
| - sudo systemctl enable <service-name> | |
| - sudo systemctl disable <service-name> | |
| KERNEL/info: | |
| - uname | |
| - uname -a | |
| - uname -p | |
| - ... | |
| SERVIZOS KERNEL: | |
| - GRUB & liña comandos kernel | |
| - /proc/cmdline | |
| - sysctl -a # ler e axustar params Kernel | |
| - sudo sysctl net.ipv4.ip_forward=1 | |
| - /etc/sysctl.conf # config | |
| - sudo sysctl -p # aplica inmediantamente cambios sysctl.conf | |
| MÓDULOS KERNEL: | |
| - lsmod | |
| - insmod <ruta.ko> # carga módulos directamente | |
| - rmmod # descarga módulos directamente | |
| - modprobe <nome> # cargamódulos | |
| - modprobe -r <nome> # descarga módulos | |
| - depmod # reconstrue BD, dependen modprobe, modinfo | |
| - modinfo | |
| FS: | |
| [inodo: permisos; usuario; grupo; tam; rexs. tempo: último acceso/modif contido/modif inodo] | |
| - ln # enlaces | |
| + atributos extendidos [i: inmutable; a: agregar-só; d: non-backup; A: non actualizar atime (último acceso)] | |
| - lsattr <ficheiro> | |
| - chattr [+ | - | =mode] <ficheiro> | |
| - fsck | |
| - fsck.[ext4 | ...] | |
| - /etc/fstab | |
| - mount | |
| - sudo mount -o remount,ro </myfs> | |
| - umount | |
| - quotacheck | |
| - <root-fs>/aquota.user | |
| - <root-fs>/aquota.group | |
| - /etc/fstab + usrquota | |
| - quotaon | |
| - quotaoff | |
| - edquota | |
| - quota | |
| - xfs_quota | |
| - du | |
| - df | |
| - mkswap | |
| - swapon | |
| - swapoff | |
| FS/ext4 | |
| - sudo dumpe2fs </dev/...> | |
| - tune2fs | |
| - sudo tune2fs -c 25 /dev/sda1 | |
| - sudo tune2fs -i 10 /dev/sda1 | |
| - .... | |
| MONITORIZACIÓN SISTEMA: | |
| - /proc | |
| - /proc/interrupts | |
| - /proc/sys/... | |
| - sudo sysctl kernel.threads-max=100000 | |
| - /sys | |
| - /sys/class/net | |
| + Monitorización procesos/carga | |
| - top | |
| - ps | |
| - sar [opt] [intervalo] [reps] | |
| - uptime | |
| - pstree | |
| - mpstat | |
| - iostat | |
| - numastat (Non-Uniform Mem Arch) | |
| - strace | |
| + Memoria | |
| - free | |
| - vmstat | |
| - pmap | |
| + I/O | |
| - iostat | |
| - sar | |
| - vmstat | |
| + Rede | |
| - netstat | |
| - iptraf | |
| - tcpdump | |
| - wireshark | |
| PROCESOS: | |
| - top | |
| - uptime | |
| - ps | |
| - [BSD] | |
| - ps aux | |
| - ps auxf | |
| - [UNIX] | |
| - ps -elf | |
| - ps -o pid,uid,command | |
| - pstree | |
| - pstree -aAp <pid> | |
| - ls -l /proc/<pid>/task | |
| - mpstat | |
| - iostat | |
| - sar | |
| - numastat | |
| - strace | |
| I/O | |
| +Monitorización: | |
| - iostat | |
| - iostat -k (KB) | |
| - iostat -N (info by device Name) | |
| - iostat -xk (eXtended) | |
| - iotop (root|sudo) | |
| +Axuste: | |
| - ionice [-c class 1..3] [-n prio 0..7] [-p pid | command [args]] | |
| - (class planning: 1: idle, 2: best effort, 3: R-T) | |
| - ionice -c 2 -n 5 - p 30087 | |
| + Planificación (Completely Fair Queue, Deadline, noop): | |
| - (liña Kernel) linux ... elevator=[cfq | deadline | noop] | |
| - SSD? 1 en /sys/block/<device>/queue/rotational | |
| - Scheduler: <cat | echo [cfq|deadline|noop]> /sys/block/<device>/queue/scheduler | |
| - Params scheduler: /sys/block/<device>/queue/iosched | |
| MEMORIA: | |
| - /proc/sys/vm | |
| + Monitorización: | |
| - free | |
| - vmstat [opt] [intervalo] [reps] | |
| - pmap | |
| - cat /proc/meminfo | |
| - Linux --> COW | |
| - Linux --> OOM-killer (Out of Memory) | |
| SINAIS: | |
| - | |
| USUARIOS | |
| - /etc/passwd | |
| - 664 -rw-r--r-- | |
| - /etc/shadow | |
| - 400 -r-....- | |
| - useradd | |
| - userdel | |
| - usermod | |
| - usermod -L <loginname> # bloquea | |
| - chage | |
| - passwd | |
| - /etc/group | |
| - /etc/gshadow | |
| - groupads | |
| - groupmod | |
| - groupdel | |
| - usermod -G | |
| - UPG /etc/profile | |
| CS/ARQUIVADO | |
| - cpio | |
| - tar | |
| - <-- | |
| - --create --file <file.tar> | |
| - -cvf <file.tar> <directory> | |
| - -cvfz <file.tar.gz> <directory> | |
| - -cvfj <file.tar.bz2> <directory> | |
| - -cvfJ <file.tar.xz> <directory> | |
| - --> | |
| - -xpvf [file.tar.*] | |
| - -xvf [file.tar.*] | |
| - -xvfz [file.tar.gz] | |
| - -xvfj [file.tar.bz2] | |
| - -xvfJ [file.tar.xz] | |
| - --extract --same-permissions --vervose --file [file.tar] | |
| - dd | |
| - dd if=/dev/zero of=<file[.img]> bs=1M count=10 # creates 10MB file | |
| - rsync [opt] src destination | |
| - dump | |
| - restore | |
| - mt | |
| REDE | |
| - /etc/hostname | |
| - hostname | |
| - (prev systemd) /etc/sysconfig/network | |
| - hostnamectl set-hostame <name> # systemd | |
| - ping | |
| - traceroute | |
| - mtr | |
| - dig | |
| - nslookup | |
| - nmap | |
| - nmap -v -sn 192.168.1.0/24 # host stastus in that network, scan by IP | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment