# 시간 확인
date
> Wed Apr 28 00:02:28 KST 2022
# 타임존 확인
more /etc/timezone
> Asia/Seoul
# 현재 서버 시간 백업(.dist 파일)
sudo cp /etc/localtime /etc/localtime.dist
# 현재 서버 시간을 Asia/Seoul 타임존으로 심볼릭 링크 생성
# 이미 생성된 링크가 있을 수도 있기에 -fs 플래그 사용
sudo ln -fs /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# Asia/Seoul 문자열 출력
echo "Asia/Seoul"
# 출력된 문자열을 타임존에 저장
sudo tee /etc/timezone
# 설정한 타임존 정보를 저장하고, 서버에 적용
sudo dpkg-reconfigure --frontend noninteractive tzdata
# 타임존 정보 백업(.dist 파일)
sudo cp /etc/timezone /etc/timezone.dist
한번에 실행시키기
sudo su
sudo cp /etc/localtime /etc/localtime.dist
sudo ln -fs /usr/share/zoneinfo/Asia/Seoul /etc/localtime
sudo cp /etc/timezone /etc/timezone.dist
echo "Asia/Seoul" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
서버 시간 설정 툴
tzselect
timedatectl
dpkg-reconfigure
///강제로 시간을 변경하고 싶을경우 명령어 실행
date -s "2022-03-28 18:32:40"