본문 바로가기

Work/Linux(6.x)_centos

(23)
centos6 selinux 설정 1. 상태 확인# sestatusSELinux status: enabledSELinuxfs mount: /selinuxCurrent mode: enforcingMode from config file: enforcingPolicy version: 24Policy from config file: targeted 2. 임시 설정 # setenforce 0 ( 비활성화 )# setenforce 1 ( 활성화 ) 3. /etc/sysconfig/selinux 파일에서 설정vi /etc/sysconfig/selinuxSELINUX=enforcing, permissive, disabled 에서 선택 재부팅 후 적용 ** 요약 **# sestatus 상태 확인# setenforce 0 or 1 임시 설정/etc/sys..
centos6 사용중인 포트 확인 #netstat -tulpn | grep LISTEN [root@centos6 /]# netstat -tulpn | grep LISTENtcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1593/rpcbindtcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1809/sshdtcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1674/cupsdtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2035/mastertcp 0 0 0.0.0.0:40732 0.0.0.0:* LISTEN 1641/rpc.statdtcp 0 0 :::111 :::* LISTEN 1593/rpcbindtcp 0 0 :::37620 :::* LISTEN 1641/rpc...
centos6 hostname 변경 /etc/sysconfig/network 파일에HOSTNAME=호스트네임 설정 후 reboot 필요
centos6 ssh 접속시 느릴때 1. /etc/ssh/sshd_config 파일에 UseDNS no 추가후 sshd 서비스 재시작 service sshd restart 2. /etc/hosts 파일에 자기 자신의 ip 자기 자신의 호스트네임 [root@centos6 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.233.128 centos6
centos 일회성 작업 예약 at 명령어 1. 작업 예약 # at at> 실행할 명령어 입력 후 엔터완료되면 Ctrl+D 2. 확인 # at -l 3. 삭제# atrm %%%%%%%%%%%%%%%%%%%%%%%%%%[root@centos /]# at now +1 hourat> ls -al > /lsat> job 2 at 2015-07-22 14:45[root@centos /]# at -l2 2015-07-22 14:45 a root[root@centos /]# atrm 2[root@centos /]# at -l%%%%%%%%%%%%%%%%%%%%%%%%%%
centos,Redhat storage Fc 카드 관련 /sys/class/fc_host/host# * Scanning Storage Interconnects *1. echo 1 > /sys/class/fc_host/host1/issue_lip 2. /usr/bin/rescan-scsi-bus.sh 3. lsmod | grep qlaqla2xxx 469784 8qla4xxx 275503 0 3-1. rmmod qla2xxx qla4xxx
centos root password 복구 rescue mode에서 Starting shell...bash-4.1# chroot /mnt/sysimage sh-4.1# passwd Changing password for user root. New password: Retype new password: passwd: all authentication tokens updated successfully. sh-4.1# exit exit bash-4.1# reboot
Centos local root 로그인 막기 /etc/securetty 파일에서 tty 부분 모두 주석처리 [root@dk-test ~]# cat /etc/securettyconsolevc/1vc/2vc/3vc/4vc/5vc/6vc/7vc/8vc/9vc/10vc/11#tty1#tty2#tty3#tty4#tty5#tty6#tty7#tty8#tty9#tty10#tty11 ** 참고 **출처 : https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-wstation-privileges-noroot.htmlethodDescriptionEffectsDoes Not AffectChanging the root shell.Edit the /etc/passwd file and change the shell from..