linux installation checklist

리눅스를 설치할 때 항상 반복하는 작업들

root user 비밀번호 설정

$ sudo passwd

패키지 관리자 저장소를 지역 미러로 설정

fedora

  • fastest mirror 플러그인 활성화
$ echo "fastestmirror=True" | sudo tee -a /etc/dnf/dnf.conf && sudo dnf makecache --refresh

centos

  • /etc/yum.repos.d/에 아래의 기존 repo들은 압축 후, 카카오 미러용 repo파일 추가
[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.daumkakao.com/centos/$releasever/os/$basearch/
gpgcheck=0
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.daumkakao.com/centos/$releasever/updates/$basearch/
gpgcheck=0
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.daumkakao.com/centos/$releasever/extras/$basearch/
gpgcheck=0

ubuntu

  • 카카오 미러 사용
$ sudo sed -i 's/archive.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list

소프트웨어 설치

공통

  • sshd
  • git
  • vim
  • wget
  • curl
  • htop
  • tmux

배포마다 다름

centos

  • epel-release
  • ‘Development Tools’ sudo yum -y groupinstall 'Development Tools'

fedora

  • ‘Development Tools’ sudo dnf -y groupinstall 'Development Tools'
  • gcc-c++ (for g++)

ubuntu

  • ‘build-essential’

gui 환경

자주 쓰는 소프트웨어

  • docker
  • docker-compose
  • chrome
    $ sudo dnf install -y fedora-workstation-repositories
    $ sudo dnf config-manager --set-enabled google-chrome
    $ sudo dnf install -y google-chrome-stable
    
  • miniconda3
  • xrdp
  • snapd
  • cmake
  • ctags (exuberant-ctags)
  • python3
  • python3-pip
  • nano

selinux 끄기

  • /etc/selinux/config 파일을 열고 SELINUX=disabled 로 수정
  • reboot

방화벽 zone 설정

  • (gui 툴 사용이 가능한 경우) firewall-config 설치하여 사용
  • 집에서 쓰는경우 home

ssh 설정

  • .ssh 디렉터리 만들기. 권한 700
  • 키 생성
    • 다른 기기에 접속하기 위한 기본 키, git ssh 용 키
$ ssh-keygen -t rsa -b 2048 -C "Default ${HOSTNAME}'s ${USER} key" -f "${HOME}/.ssh/id_rsa"
$ ssh-keygen -t rsa -b 2048 -C "${HOSTNAME} ${USER}'s git key" -f "${HOME}/.ssh/${HOSTNAME}_git_key"
  • config 파일 생성. 권한 400
Host yourhostname
    Hostname 192.168.0.1
    IdentityFile ~/.ssh/id_rsa
    User remote_user
    Port 22

Host github.com
    hostname github.com
    user git
    identityfile ~/.ssh/${HOSTNAME}_git_key

Host gitlab.com
    hostname gitlab.com
    user git
    identityfile ~/.ssh/${HOSTNAME}_git_key

Host bitbucket.org
    hostname bitbucket.org
    user git
    identityfile ~/.ssh/${HOSTNAME}_git_key

Host gitlab.diyaml.com
    hostname gitlab.diyaml.com
    user git
    identityfile ~/.ssh/${HOSTNAME}_git_key

Host yoursecondhostname
    Hostname 192.168.0.2
    IdentityFile ~/.ssh/id_rsa
    User remote_user
    Port 22
    IdentitiesOnly yes
    PreferredAuthentications publickey
    LocalForward 8080 127.0.0.1:8080
$ chmod u+w "${HOME}/.ssh/config" && vim "${HOME}/.ssh/config" && chmod u-w "${HOME}/.ssh/config"
  • 공개 키를 접속을 원하는 호스트에 등록

Read more