IT/linux2023. 10. 11. 20:54[linux] firewalld

/etc/firewalld/zones/ firewalld-cmd --get-default-zone firewalld-cmd --list-all #포트 추가 firewalld-cmd --zone=public --add-port=8080/tcp #포트 제거 firewalld-cmd --zone=public --remove-port=8080/tcp #port 범위 허용 firewall-cmd --add-port=8000-9000/tcp firewall-cmd --remove-port=8000-9000/tcp #ip 대역 허용 firewall-cmd --add-source=192.168.0.0/24 firewall-cmd --remove-source=192.168.0.0/24 #승인 firewalld-cmd -..

IT/linux2023. 10. 11. 20:30[linux] single mode booting

CentOS 7 부팅 시 커널 선택에서 'e' -> rhgb quiet -> init=/bin/bash 수정 후 ctrl + x # mount -o remount,rw / # passwd ${id} ## selinux enforcing # touch /.autorelabel ## selinux disable # exec /sbin/init CentOS 8 부팅 시 커널 선택에서 'e' -> rhgb quiet 뒤에 'rd.break' 추가 후 ctrl + x # mount -o remount,rw /sysroot # chroot /sysroot # paswwd ${id} ## selinux enforcing # touch /.autorelabel ## selinux disable # exec /sbin/..

IT/linux2023. 10. 11. 20:28[linux] error: disk ‘lvmid/’ not found

error: disk 'lvmid/Z88N2t-AUog-uRIG-wzbb-9rKD-F3Bi-iswZdD/n6QwzH-lWyG-6fMZ-ITxi-aPoq-FQTc-HrncWi' not found.' Entering rescue mode... 1. ubuntu cd 부팅 2. try ubuntu (클릭) 3. terminal # sudo lvscan ACTIVE '/dev/vgubuntu/root' [977.58 GiB] inherit ACTIVE '/dev/vgubuntu/swap_1' [1.91 Gib] ingerit # sudo mount /dev/vgubuntu/root /mnt # cd /mnt # sudo mount --bind /dev dev # sudo mount --bind /sys sys ..

[linux] contains a file system with errors, check forced.
IT/linux2023. 10. 11. 20:25[linux] contains a file system with errors, check forced.

#error [/sbin/fsck.ext4 (1) — /dev/sda1] fsck.ext4 -a -C0 /dev/sda1 /dev/sda1 contains a file system with errors, check forced. /dev/sda1: Inodes that were part of a corrupted orphan linked list found. /dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) fsk exited with status codr 4 done. Failuer: File system check of the root filesystem failed The root files..

IT/linux2023. 3. 30. 13:22[linux] nfs 설치, 설정

환경 : Ubuntu 20.04 # Server (10.109.0.2) apt install nfs-utils apt install nfs-kernel-server # create share directory mkdir /share chmod 777 /share # firewalld or ufw ufw allow 2049/tcp,udp firewall-cmd --permanent --add-service=nfs firewall-cmd --permanent --add-port=2049/tcp firewall-cmd --permanent --add-port=2049/udp firewall-cmd --reload # chage conf vi /etc/exports ##### # (mount point) (ho..

IT/linux2023. 3. 29. 09:49[linux] kernel: NMI watchdog: BUG: soft lockup - CPU#3 stuck for 82s! [pickup:18943]

URL : https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/parameters-controlling-kernel-panic_keeping-kernel-panic-parameters-disabled-in-virtualized-environments OS : CentOS 7.9 kernel: NMI watchdog: BUG: soft lockup - CPU#15 stuck for 72s! [chronyd:99] kernel: NMI watchdog: BUG: soft lockup - CPU#9 stuck for 71s! [systemd-jo..

IT/linux2023. 3. 29. 09:35[linux] pam_tally2(login:account): unknown option: no_magic_root, reset

OS : CentOS 7.9 CentOS 5까지는 pam_tally.so 사용. CentOS 6부턴 pam_tally2.so no_magic_root, reset은 man page에 존재하지 않는다. 따라서, 옵션 삭제 # /var/log/secure mar 28 03:03:53 localhost login: pam_tally2(login:account): unknown option: no_magic_root mar 28 03:03:53 localhost login: pam_tally2(login:account): unknown option: reset ### 수정 전 # PATH /etc/pam.d/system-auth auth required /lib64/security/pam_tally2.so de..

IT/linux2023. 3. 29. 09:24[linux] ping: socket: Operation not permitted

# error message ping: socket: Operation not permitted sysctl -w net.ipv4.ping_group_range="0 1000"

IT/linux2022. 9. 30. 11:05[linux] ubuntu Error: Waiting for cache lock

환경 OS : Ubuntu 20.04 LTS error 'Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend’ solution sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock* # 이후 패키지 업데이트 sudo dpkg --configure -a sudo apt update

IT/linux2022. 9. 30. 11:03[linux] Google Authenticator

환경 OS : Ubuntu 20.04 LTS apt install libpam-google-authenticator # 2차 인증 적용할 계정으로 전환 su - ${id} google-authenticator vi /etc/pam.d/sshd # 추가 # google otp auth required pam_google_authenticator.so nullok vi /etc/ssh/sshd_config # 변경 UsePAM yes ChallengeResponseAuthentication Yes systemctl restart sshd # key 조회 가능 cat /home/${user}/.google_authenticator

IT/linux2022. 8. 26. 21:40[linux] sftp log

목적 : sftp 프로토콜 사용시 사용자의 접속 시간, ip, 경로를 확인하기 위함 환경 : Ubuntu 20.04 man sftp-server -f type = DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. -l type = QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, DEBUG3 vi /etc/ssh/sshd_config # Logging SyslogFacility local4 #LogLevel DEBUG1 # override default of no subsystems # log_facility, log_level 설정 # add Sub..

IT/linux2022. 8. 25. 23:33[linux] ntp 설정

환경 : Ubuntu 20.04 # ntp install apt-get install ntp # vi /etc/ntp.conf # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help driftfile /var/lib/ntp/ntp.drift # Leap seconds definition provided by tzdata leapfile /usr/share/zoneinfo/leap-seconds.list # Enable this if you want statistics to be logged. #statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopst..

image