ubuntu 24.04 linux 초기 설치 및 ssh 외부접속 허용
Updated on
목차
이번에 미니PC를 구매했다.
리눅스 커널 컨트롤을 해야되는데, 지금 사용중인 서버컴퓨터에서 하기에는 보안상 리스크가 있다고 판단되서 새로 미니PC를 알리에서 구매했다.
그래서 almaLinux 말고 ubuntu 기준으로 작성해본다.
root 허용 및 sshd 접속 허용#
passwd root
sudo -i
apt update
apt install vim
apt install openssh-server
vim /etc/ssh/sshd_config
Port 22222
PermitRootLogin yes
systemctl restart sshufw 방화벽 해제#
systemctl stop ufw
systemctl disable ufw
reboot텍스트 모드로 부팅하기#
systemctl set-default multi-user.targetdocker install#
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl start docker
systemctl enable docker
docker run hello-worldCPU, MEMORY 확인#
cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logolscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: AuthenticAMD
BIOS Vendor ID: Advanced Micro Devices, Inc.
Model name: AMD Ryzen 5 6600H with Radeon Graphics도커 네트워크 생성 실패 에러#
docker network create backend
Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-2bbd93766d2a -j RETURN: iptables: No chain/target/match by that name.
(exit status 1))도커 네트워크를 설치하려는데 위 에러가 발생하는 경우는 iptable 에 docker network 가 없기 때문이다.
iptables -t nat -L -n -v
systemctl restart docker도커를 재시작 시켜주면 된다. (어디선가 iptables -F 로 초기화 시키고 있기 때문에 발생될 수 있음)