웹사이트 검색

Ubuntu 22.04에 Bitwarden Password Manager를 설치하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • Ubuntu 22.04(Jammy Jellyfish)
  • Ubuntu 20.04(Focal Fossa)

이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. Docker CE 저장소 설치
  4. Docker CE 설치
  5. Docker Compose 설치
  6. Bitwarden용 사용자 만들기
  7. Ubuntu 22.04에 Bitwarden Password Manager 설치
  8. Bitwarden 웹 인터페이스 액세스
  9. 결론

Bitwarden은 모든 로그인 및 암호를 저장하고 모든 장치 간에 동기화할 수 있는 무료 오픈 소스 암호 관리자입니다. 크로스 플랫폼이며 Linux 및 Windows 및 macOS와 같은 기타 모든 주요 운영 체제에서 사용할 수 있습니다. 강력한 암호화, 2단계 인증(2FA), 암호 보안 감사, 암호 위반 모니터링, 클라우드 또는 로컬 호스팅 옵션을 비롯한 유용한 기능이 많이 있습니다.

이 게시물에서는 Ubuntu 22.04에 Bitwarden Password Manager 소프트웨어를 설치하는 방법을 보여줍니다.

전제 조건

  • Ubuntu 22.04를 실행하는 서버.\n
  • 루트 암호는 서버에서 구성됩니다.\n

시작하기

먼저 모든 시스템 패키지를 최신 버전으로 업데이트하고 업그레이드하는 것이 좋습니다. 다음 명령을 실행하여 업데이트할 수 있습니다.

apt update -y
apt upgrade -y

모든 패키지가 업그레이드되면 다음 명령을 실행하여 필요한 추가 종속성을 설치합니다.

apt install apt-transport-https ca-certificates curl software-properties-common -y

모든 종속성이 설치되면 다음 단계로 진행할 수 있습니다.

Docker CE 리포지토리 설치

다음으로 Docker CE 공식 리포지토리를 APT에 추가해야 합니다. 먼저 다음 명령을 사용하여 Docker GPG 키를 추가합니다.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

다음으로 다음 명령을 사용하여 Docker CE 리포지토리를 추가합니다.

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"

Docker 리포지토리가 APT에 추가되면 다음 단계로 진행할 수 있습니다.

도커 CE 설치

이제 다음 명령을 사용하여 최신 버전의 Docker CE를 설치할 수 있습니다.

apt install docker-ce -y

Docker가 설치되면 다음 명령을 사용하여 Docker 서비스의 상태를 확인합니다.

systemctl status docker

다음 출력에 Docker 상태가 표시됩니다.

? docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-28 05:52:18 UTC; 47s ago
TriggeredBy: ? docker.socket
       Docs: https://docs.docker.com
   Main PID: 2719 (dockerd)
      Tasks: 7
     Memory: 30.3M
        CPU: 312ms
     CGroup: /system.slice/docker.service
             ??2719 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.379341986Z" level=info msg="scheme \"unix\" not registered, fallback to d>
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.379467088Z" level=info msg="ccResolverWrapper: sending update to cc: {[{u>
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.379593467Z" level=info msg="ClientConn switching balancer to \"pick_first>
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.427861369Z" level=info msg="Loading containers: start."
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.620267088Z" level=info msg="Default bridge (docker0) is assigned with an >
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.713742709Z" level=info msg="Loading containers: done."
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.744925054Z" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=>
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.745338168Z" level=info msg="Daemon has completed initialization"
Aug 28 05:52:18 ubuntu2204 systemd[1]: Started Docker Application Container Engine.
Aug 28 05:52:18 ubuntu2204 dockerd[2719]: time="2022-08-28T05:52:18.805663866Z" level=info msg="API listen on /run/docker.sock"

Docker Compose 설치

또한 Docker Compose를 시스템에 설치해야 합니다. 다음 명령으로 다운로드하여 설치할 수 있습니다.

curl -sL "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

다음으로, 다음 명령을 사용하여 다운로드한 바이너리에 대한 실행 권한을 설정합니다.

chmod +x /usr/local/bin/docker-compose

다음으로 다음 명령을 사용하여 Docker Compose 버전을 확인합니다.

docker-compose --version

다음과 같은 결과가 표시됩니다.

docker-compose version 1.29.2, build 5becea4c

Bitwarden용 사용자 생성

Bitwarden을 전용 사용자로 실행하는 것이 좋습니다. 다음 명령을 사용하여 새 사용자를 만들고 sudo 및 docker 그룹에 추가할 수 있습니다.

useradd -G docker,sudo -s /bin/bash -m -d /opt/bitwarden bitwarden

그런 다음 다음 명령을 사용하여 사용자 암호를 설정합니다.

passwd bitwarden

다음 출력이 표시되어야 합니다.

New password: 
Retype new password: 
passwd: password updated successfully

다음으로 소유권을 bitwarden 디렉터리로 변경합니다.

chown -R bitwarden: /opt/bitwarden

Ubuntu 22.04에 Bitwarden Password Manager 설치

먼저 Bitwarden 호스팅 페이지를 방문하여 아래와 같이 Bitwarden 설치 키와 ID를 얻습니다.

그런 다음 사용자를 Bitwarden으로 전환하고 다음 명령을 사용하여 Bitwarden 설치 스크립트를 다운로드합니다.

su - bitwarden
curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh

다음으로 다운로드한 스크립트에 대한 실행 권한을 설정합니다.

chmod +x bitwarden.sh

다음으로 다음 명령을 사용하여 Bitwarden 암호 관리자를 설치합니다.

sudo ./bitwarden.sh install

아래와 같이 도메인 또는 IP, SSL 정보 및 데이터베이스 이름을 제공하라는 메시지가 표시됩니다.

 _     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2022, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2022.8.4
Docker version 20.10.17, build 100c701
docker-compose version 1.29.2, build 5becea4c

(!) Enter the domain name for your Bitwarden instance (ex. bitwarden.example.com): 208.117.81.243

(!) Do you want to use Let's Encrypt to generate a free SSL certificate? (y/n): n

(!) Enter the database name for your Bitwarden instance (ex. vault): bitwarden

필요한 모든 정보를 제공하고 Enter 키를 누릅니다. Bitwarden 설치 키, ID 및 SSL 정보를 제공하라는 메시지가 표시됩니다.

2022.8.4: Pulling from bitwarden/setup
1efc276f4ff9: Pull complete 
e5aeae5c9ad4: Pull complete 
9d8b4edc672a: Pull complete 
67bb3a123350: Pull complete 
4b31f33ff8ee: Pull complete 
8302c6d93c2f: Pull complete 
64c1ff0e03a3: Pull complete 
289e8b648bb1: Pull complete 
c706fe453135: Pull complete 
6b18bfe90415: Pull complete 
Digest: sha256:257317606bad7b6c06755c81e4f61099b4af8b89829d7a9a2688545b92daa45f
Status: Downloaded newer image for bitwarden/setup:2022.8.4
docker.io/bitwarden/setup:2022.8.4

(!) Enter your installation id (get at https://bitwarden.com/host): c1908405-5beb-497f-9f09-aefe00f87c3f

(!) Enter your installation key: yQVH9PTcUIPftio0ZM8L

(!) Do you have a SSL certificate to use? (y/n): n

(!) Do you want to generate a self-signed SSL certificate? (y/n): y

필요한 모든 정보를 제공하고 Enter 키를 누릅니다. Bitwarden이 설치되면 다음 출력이 표시됩니다.

Generating key for IdentityServer.
Generating a RSA private key
.........................++++
.++++
writing new private key to 'identity.key'
-----

!!!!!!!!!! WARNING !!!!!!!!!!
You are not using a SSL certificate. Bitwarden requires HTTPS to operate. 
You must front your installation with a HTTPS proxy or the web vault (and 
other Bitwarden apps) will not work properly.

Building nginx config.
Building docker environment files.
Building docker environment override files.
Building FIDO U2F app id.
Building docker-compose.yml.

Installation complete

If you need to make additional configuration changes, you can modify
the settings in `./bwdata/config.yml` and then run:
`./bitwarden.sh rebuild` or `./bitwarden.sh update`

Next steps, run:
`./bitwarden.sh start`

이제 다음 명령을 사용하여 Bitwarden 서비스를 시작하십시오.

sudo ./bitwarden.sh start

다음 출력이 표시되어야 합니다.

bitwarden.sh version 2022.8.4
Docker version 20.10.17, build 100c701
docker-compose version 1.29.2, build 5becea4c

Pulling mssql         ... done
Pulling web           ... done
Pulling attachments   ... done
Pulling api           ... done
Pulling identity      ... done
Pulling sso           ... done
Pulling admin         ... done
Pulling icons         ... done
Pulling notifications ... done
Pulling events        ... done
Pulling nginx         ... done
Creating directory /opt/bitwarden/bwdata/core
Creating directory /opt/bitwarden/bwdata/core/attachments
Creating directory /opt/bitwarden/bwdata/logs
Creating directory /opt/bitwarden/bwdata/logs/admin
Creating directory /opt/bitwarden/bwdata/logs/api
Creating directory /opt/bitwarden/bwdata/logs/events
Creating directory /opt/bitwarden/bwdata/logs/icons
Creating directory /opt/bitwarden/bwdata/logs/identity
Creating directory /opt/bitwarden/bwdata/logs/mssql
Creating directory /opt/bitwarden/bwdata/logs/nginx
Creating directory /opt/bitwarden/bwdata/logs/notifications
Creating directory /opt/bitwarden/bwdata/logs/sso
Creating directory /opt/bitwarden/bwdata/logs/portal
Creating directory /opt/bitwarden/bwdata/mssql/backups
Creating directory /opt/bitwarden/bwdata/mssql/data
Creating network "docker_default" with the default driver
Creating network "docker_public" with the default driver
Creating bitwarden-notifications ... done
Creating bitwarden-events        ... done
Creating bitwarden-icons         ... done
Creating bitwarden-mssql         ... done
Creating bitwarden-attachments   ... done
Creating bitwarden-web           ... done
Creating bitwarden-sso           ... done
Creating bitwarden-identity      ... done
Creating bitwarden-api           ... done
Creating bitwarden-admin         ... done
Creating bitwarden-nginx         ... done
2022.8.4: Pulling from bitwarden/setup
Digest: sha256:257317606bad7b6c06755c81e4f61099b4af8b89829d7a9a2688545b92daa45f
Status: Image is up to date for bitwarden/setup:2022.8.4
docker.io/bitwarden/setup:2022.8.4


Bitwarden is up and running!
===================================================

visit http://bitwarden.example.com
to update, run `./bitwarden.sh updateself` and then `./bitwarden.sh update`

다음 명령을 사용하여 다운로드한 모든 도커 이미지를 확인할 수 있습니다.

sudo docker images

다음과 같은 결과가 표시됩니다.

REPOSITORY                TAG        IMAGE ID       CREATED       SIZE
bitwarden/mssql           2022.8.4   0fde97fd6c2b   11 days ago   1.4GB
bitwarden/setup           2022.8.4   c3f86466c311   11 days ago   271MB
bitwarden/notifications   2022.8.4   ad800e29d1bf   11 days ago   286MB
bitwarden/identity        2022.8.4   39342ec67118   11 days ago   284MB
bitwarden/nginx           2022.8.4   a9e4cdb98e3d   11 days ago   144MB
bitwarden/icons           2022.8.4   e52e97fcc4c1   11 days ago   285MB
bitwarden/admin           2022.8.4   25fe354a8fa2   11 days ago   346MB
bitwarden/sso             2022.8.4   345ee4d3d544   11 days ago   289MB
bitwarden/events          2022.8.4   012f3c8dc079   11 days ago   284MB
bitwarden/api             2022.8.4   f780a0e0bfbf   11 days ago   289MB
bitwarden/attachments     2022.8.4   8b08874c96fc   11 days ago   214MB
bitwarden/web             2022.8.1   1ac4e585d2dd   2 weeks ago   247MB

실행 중인 모든 컨테이너를 확인하려면 다음 명령을 실행합니다.

sudo docker ps

다음 출력이 표시되어야 합니다.

CONTAINER ID   IMAGE                              COMMAND            CREATED          STATUS                             PORTS                                                                                    NAMES
9af240bb8845   bitwarden/nginx:2022.8.4           "/entrypoint.sh"   33 seconds ago   Up 28 seconds (health: starting)   80/tcp, 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp   bitwarden-nginx
4758bb5d8c6c   bitwarden/admin:2022.8.4           "/entrypoint.sh"   39 seconds ago   Up 33 seconds (health: starting)   5000/tcp                                                                                 bitwarden-admin
2814dd1eddd2   bitwarden/identity:2022.8.4        "/entrypoint.sh"   45 seconds ago   Up 35 seconds (healthy)            5000/tcp                                                                                 bitwarden-identity
22fa6c748d4f   bitwarden/sso:2022.8.4             "/entrypoint.sh"   45 seconds ago   Up 34 seconds (health: starting)   5000/tcp                                                                                 bitwarden-sso
9906ace7ea69   bitwarden/api:2022.8.4             "/entrypoint.sh"   45 seconds ago   Up 34 seconds (healthy)            5000/tcp                                                                                 bitwarden-api
1d1f10c10667   bitwarden/mssql:2022.8.4           "/entrypoint.sh"   45 seconds ago   Up 39 seconds (health: starting)                                                                                            bitwarden-mssql
f7ab34d501cc   bitwarden/attachments:2022.8.4     "/entrypoint.sh"   45 seconds ago   Up 37 seconds (healthy)                                                                                                     bitwarden-attachments
6646bf077ba8   bitwarden/web:2022.8.1             "/entrypoint.sh"   45 seconds ago   Up 39 seconds (healthy)                                                                                                     bitwarden-web
e73076475cc7   bitwarden/icons:2022.8.4           "/entrypoint.sh"   45 seconds ago   Up 35 seconds (health: starting)   5000/tcp                                                                                 bitwarden-icons
535f2f7599c1   bitwarden/events:2022.8.4          "/entrypoint.sh"   45 seconds ago   Up 35 seconds (healthy)            5000/tcp                                                                                 bitwarden-events
7a489f258459   bitwarden/notifications:2022.8.4   "/entrypoint.sh"   45 seconds ago   Up 34 seconds (healthy)            5000/tcp                                                                                 bitwarden-notifications

Bitwarden 웹 인터페이스에 액세스

이 시점에서 Bitwarden 암호 관리자가 설치되고 구성됩니다. 이제 URL https://your-server-ip를 사용하여 웹 UI에 액세스할 수 있습니다. Bitwarden 로그인 페이지가 표시됩니다.

계정 만들기 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

이메일 주소, 마스터 비밀번호를 입력하고 계정 만들기 버튼을 클릭합니다. 계정이 생성되면 Bitwarden 로그인 페이지로 리디렉션됩니다.

이메일 주소, 비밀번호를 입력하고 로그인 버튼을 클릭합니다. 다음 페이지에서 Bitwarden 대시보드를 볼 수 있습니다.

결론

축하합니다! Ubuntu 22.04에서 Docker와 함께 Bitwarden Password Manager를 성공적으로 설치했습니다. 이제 암호를 추가하고 여러 장치 간에 암호를 공유할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.