1. 우분투 이미지 다운로드
docker -> 레지스트리 -> ubuntu 검색 후 ubuntu 다운로드

2. 우분투 컨테이너 생성 및 설정
docker -> 이미지 -> ubuntu -> 실행



3. 우분투 컨테이너 실행
docker -> 컨테이너 -> ubuntu 컨테이너 실행

4. 우분투 컨테이너 콘솔 접속
$ sudo su -
Password:
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4dd44c247878 ubuntu:latest "/bin/bash" 22 hours ago Up 44 minutes 0.0.0.0:5822->22/tcp ubuntu1
# docker exec -it 4dd44c247878 /bin/bash
root@ubuntu1:/#
5. ssh 설치
# apt-get update
# apt-get install ssh
# service ssh restart
6. ssh 관련 추가 설정: 아래 각 항목들 설정
# apt-get install vim
# vim /etc/ssh/sshd_config
...
PermitRootLogin no : 루트 계정 로그인 불허
AllowUsers xxxxxxx : 특정 유저만 접근 허용
...
# service ssh restart
7. sudo 설치 및 sudo 그룹 확인
# apt-get install sudo
# cat /etc/sudoers
...
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
...
8. 유저 추가 및 sudo 그룹 설정
(당장은 개인 내부망에서만 사용할 장난감이니 유저가 모든 권한 가지도록 설정.)
# adduser xxxxxxx
# usermod -g sudo xxxxxxx
※ 2020. 05. 31일 작업 중, sudo 수행 시 아래 에러 발생함, 조치 방법 참고
-> sudo : setrlimit(RLIMIT_CORE): Operation not permitted 에러 발생 시 아래 명령 수행
# echo "Set disable_coredump false" >> /etc/sudo.conf