2021. 12. 11. 09:17ㆍOS
Bit 확인
getconf LONG_BIT
CentOS SELinux 해제
상태 확인
sestatus
설정
해제
vi /etc/selinux/config
SELINUX=disabled
#SELINUX=enforcing
재기동
reboot
Firewall 포트 등록 및 확인
firewall-cmd --list-all
firewall-cmd --add-port=포트/tcp --permanent
firewall-cmd --add-port=포트/udp --permanent
firewall-cmd --remove-port=포트/tcp --permanent
sudo systemctl restart firewalld
ssh를 이용한 파일 다운로드
SSH를 이용한 파일 다운로드 하기 :: SCP
SSH 클라이언트가 설치되어 있는 환경에서 사용하시면 됩니다 SSH 클라이언트가 없는 분들은 클라이언트를 설치해 주세요 $ yum install openssh-clients 원격 에서 파일을 받는 방법은 아래와 같습니다 $
www.lanian.co.kr
scp root@192.168.0.2:/home/root/abc.txt ./
sshd 서비스 등록
systemctl enable sshd
systemctl restart sshd
systemctl status sshd
hostname
hostname : hostname 확인
hostname '변경할 이름' : hostname 변경
network 툴 설치
yum install bind-utils -y : nslookup
yum install ifconfig -y
yum install traceroute -y
yum install net-tools -y : route
scp
ssh로 파일 다운로드/업로드
다운로드 : scp -P 22 test@192.168.0.3:./test.tar ./
업로드 : scp ./test.tar -P 22 test@192.168.0.3:./
Hostname 변경
hostname 이름 : 컴퓨터 꺼지면 사라짐
영구적으로 변경
https://phoenixnap.com/kb/how-to-set-or-change-a-hostname-in-centos-7
How to Set or Change a Hostname in CentOS 7 | PhoenixNAP KB
Learn The Easy Way To Set or Change the Hostname in CentOS 7. An Updated tutorial with multiple methods, including using Linux command line tools.
phoenixnap.com
hostnamectl
hostnamectl set-hostname 이름
hostnameclt
reboot
Port 오픈 확인
리눅스 원격 포트 점검 - 제타위키
zetawiki.com
# nmap
sudo yum install nmap -y
nmap -NP daum.net -P80 | grep ^80
또는
nmap daum.net -p 80
tcping 설치
yum install wget
https://centos.pkgs.org/7/epel-x86_64/tcping-1.3.5-19.el7.x86_64.rpm.html
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/t/tcping-1.3.5-19.el7.x86_64.rpm
rpm -ivh tcping-1.3.5-19.el7.x86_64.rpm
10일 결과한 로그 삭제
https://lovemewithoutall.github.io/it/linux-log-clear/
리눅스 서버 용량 확보 방법(log 간편 정리)
관리가 제대로 되지 않고 있는 리눅스 서버가 하나 있다. 이 서버의 log 파일을 지우기 위해 사용하는 명령어를 사용 순서대로 정리해보았다.
lovemewithoutall.github.io
find ./ -name '*.log.*' -mtime +10 -delete
프로세스 삭제
kill `ps -ef |grep tomcat |grep -v grep | awk '{print $2}'`
에러가 나더라도 정상처리
kill `ps -ef |grep tomcat |grep -v grep | awk '{print $2}'` || true
남은 용량 확인
https://uzihoon.com/post/831cf540-adf4-11ea-b011-b113e86828fc
UZILOG
uzihoon.com
du -h : 현재 디렉토리의 용량을 깔끔하게 보여줌
실행하는 스크립트 경로 확인
[bash] 파일, 디렉토리 경로(path) 다루기 dirname, basename
Github의 여러가지 오픈 소스를 보면, 각 프로젝트별로 자신들이 사용하는 Path를 bash script를 통해 참 깔끔하게 정리합니다. 그렇게 잘 정리된 프로젝트는 개발자가 해당 오픈 소스 프로젝트를 사
educoder.tistory.com
#/temp/temp.sh
echo $0
echo $(dirname $0)
echo $(basename $0)
# ./tesmp.sh 실행
/temp/temp.sh
/temp
temp.sh
'OS' 카테고리의 다른 글
핸드폰 루팅 (0) | 2021.12.11 |
---|---|
Alpine 명령어 (0) | 2021.12.11 |
Alpine 설치 (0) | 2021.12.11 |
Termux 사용하기 (0) | 2021.11.28 |
wifi 연결 (0) | 2021.06.27 |