반응형
안녕하세요 유똥입니다.
Ubutnu 22.04 설치 후 기본설정에 대해서 포스팅 진행하겠습니다.
root 권한 로그인 및 패스워드 변경
sudo su - root
[sudo] password for
passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
패키지 리스트 갱신
apt-get update
Hit:1 http://kr.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 336 kB in 2s (148 kB/s)
Reading package lists... Done
SSH RootLogin 설정
1) PermitRootLogin 활성화
root@q391-0000:~# vim /etc/ssh/sshd_config
PermitRootLogin yes
2) SSH 서비스 재시작
root@q391-0000:~# systemctl restart sshd.service
유용한 패키지 설치
※ ifconfig
root@q391-0000:~# apt-get install -y net-tools
※ lsof
root@q391-0000:~# apt-get install -y lsof
※ tcp_wrappers
root@q391-0000:~# apt-get install -y tcpd
※ iptraf
root@q391-0000:~# apt-get install -y iptraf
※ sysstat (sar)
root@q391-0000:~# apt-get install -y sysstat
※ dev tool
root@q391-0000:~# apt-get install -y build-essential
시간 동기화 설정
1) Time Zone 설정
※ UTC -> KST로 변경
root@q391-0000:~# date
Tue May 3 06:26:42 AM UTC 2022
root@q391-0000:~# timedatectl set-timezone Asia/Seoul
root@q391-0000:~# date
Tue May 3 03:26:45 PM KST 2022
2) rdate 설치 및 시간 동기화
※ NTP 동기화도 가능하나 123번포트 허용이 필요한 부분이 있어 rdate 사용
root@q391-0000:~# apt-get install -y rdate
root@q391-0000:~# /usr/sbin/rdate -s time.bora.net; /sbin/hwclock --systohc
3) crontab 스케줄 등록
root@q391-0000:~# crontab -e
no crontab for root - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/nano <---- easiest
2. /usr/bin/vim.basic
3. /usr/bin/vim.tiny
4. /bin/ed
Choose 1-4 [1]: 2
root@q391-0000:~# crontab -l
# Time
14 3 * * * /usr/sbin/rdate -s time.bora.net; /sbin/hwclock --systohc
네트워크 설정
1) 이더넷 디바이스 적용
vim /etc/netplan/00-installer-config.yaml
network:
ethernets:
eno1:
addresses:
- IP/25
routes:
- to: default
via: 게이트웨이
nameservers:
addresses:
- 210.220.163.82
- 219.250.36.130
- 168.126.63.1
- 168.126.63.2
- 164.124.107.9
- 203.248.252.2
- 8.8.8.8
- 8.8.4.4
search: []
eno2:
dhcp4: true
version: 2
root@q391-0000:~# netplan apply
root@q391-0000:~# resolvectl status
Link 2 (eno1)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 210.220.163.82
DNS Servers: 210.220.163.82 219.250.36.130 168.126.63.1 168.126.63.2 164.124.107.9 203.248.252.2 8.8.8.8 8.8.4.4
2) systemd-resolve (Global) 적용
vim /etc/systemd/resolved.conf
[Resolve]
# SK
DNS=210.220.163.82
DNS=219.250.36.130
# KT
DNS=168.126.63.1
DNS=168.126.63.2
# LG
DNS=164.124.107.9
DNS=203.248.252.2
# GOOGLE
DNS=8.8.8.8
DNS=8.8.4.4
root@q391-0000:~# systemctl restart systemd-resolved.service
root@q391-0000:~# resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 210.220.163.82
DNS Servers: 210.220.163.82 219.250.36.130 168.126.63.1 168.126.63.2 164.124.107.9 203.248.252.2 8.8.8.8 8.8.4.4
커널 튜닝
vim /etc/security/limits.conf
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
root soft nproc 65535
root hard nproc 65535
root soft nofile 65535
root hard nofile 65535
* soft memlock unlimited
* hard memlock unlimited
vim /etc/sysctl.conf
vm.max_map_count = 262144
net.core.somaxconn = 2048
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 12582912 16777216
net.ipv4.tcp_rmem = 4096 12582912 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
이로서 Ubuntu 22.04 기본 설정에 대해서 알아보았습니다.
도움이 되셨다면 구독과 좋아요
궁금하신 내용이 있으시다면 댓글 부탁드리겠습니다!!
반응형
'IT > Linux' 카테고리의 다른 글
리눅스 ImageMagick 설치 (0) | 2022.05.31 |
---|---|
no key alg 에러 ( SSH 접속 실패 ) (0) | 2022.05.31 |
Ubuntu 22.04 LTS 서버버전 설치 (0) | 2022.05.31 |
CentOS yum 설치 안될 때 (0) | 2022.05.20 |
리눅스 호스트네임 변경 (0) | 2022.04.16 |
최근댓글