nmcli con show
nmcli connection add type ethernet ifname eth0 con-name MyConnection
nmcli connection modify MyConnection ipv4.addresses "192.168.1.100/24" ipv4.gateway "192.168.1.1" ipv4.dns "8.8.8.8"
nmcli connection up MyConnection
nmcli con modify eth0 ipv4.method manual ipv4.address ${ip address} ipv4.gateway ${gateway} ipv4.dns 168.126.63.1 connection.autoconnect yes
nmcli con reload
vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=${ip address}
GATEWAY=${gateway}
DNS1=168.126.63.1
systemctl restart NetworkManager
${ip address} = 사용할 아이피 주소
${gateway} = 사용할 게이트웨이 주소
dnf update -y
sudo dnf install epel-release
sudo dnf install -y rsync telnet cronolog wget
sudo dnf install -y qrencode ImageMagick
- epel-release: EPEL 저장소를 활성화하여 추가 패키지를 설치할 수 있도록 함.
- rsync: 파일 및 디렉토리 동기화 및 복사 도구.
- telnet: 원격 서버 접속 및 네트워크 진단 도구.
- cronolog: 로그 파일을 날짜/시간에 따라 회전시키는 도구.
- wget: 웹에서 파일을 다운로드하는 도구.
- qrencode: QR 코드 생성 도구.
- ImageMagick: 이미지 변환 및 편집 도구
vi /etc/selinux/config
> #SELINUX=enforcing
> SELINUX=disabled
vi /etc/sysctl.conf
> kernel.msgmni = 1024 추가
setenforce 0
firewall-cmd --zone=public --add-service=ssh --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --zone=public --add-service=mysql --permanent
firewall-cmd --zone=public --add-service=postgresql --permanent
firewall-cmd --zone=public --add-port=8000/tcp --permanent
firewall-cmd --reload
firewall-cmd --state
firewall-cmd --list-all
systemctl enable firewalld
systemctl restart firewalld
sudo dnf install vnstat
sudo vnstat --init
sudo systemctl start vnstat
sudo systemctl enable vnstat
vnstat -d # 일간 통계
vnstat -w # 주간 통계
vnstat -m # 월간 통계
vnstat -l # 실시간 트랙픽 확인
sudo dnf install chrony
sudo systemctl start chronyd
sudo systemctl enable chronyd
chronyc tracking
crontab -e
0 0 * * * systemctl restart chronyd
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql15-server
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
vi /var/lib/pgsql/15/data/postgresql.conf
> listen_addresses = '*'
vi /var/lib/pgsql/15/data/pg_hba.conf
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication all peer
#host replication all 127.0.0.1/32 ident
#host replication all ::1/128 ident
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
# localhost postgresql 접속
sudo -i -u postgres
psql
# postgresql
ALTER USER postgres WITH PASSWORD '1q2w3e4r';
CREATE USER ${USER ID} WITH PASSWORD '${USER PASSWD}' superuser;
CREATE DATABASE "${DATABASE_NAME}" OWNER ${USER ID} ENCODING 'UTF-8';
GRANT ALL PRIVILEGES ON DATABASE "${DATABASE_NAME}" TO ${USER ID};