VirtualBox上のAlpine Linux にssh接続可能にする

VirtualBox上のAlpine Linux にssh接続可能にする

ちょっとssh接続できるまで、面倒だったのでメモ

Alpineバージョン

# cat /etc/os-release

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.10.2
PRETTY_NAME="Alpine Linux v3.10"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

VirtualBoxネットワーク設定

ブリッジアダプターを選択

openssh インストール

## インストール
apk add openssh

sshd_config編集

## 下記を追加
vi /etc/ssh/sshd_config

<追加>
PermitRootLogin yes
PermitEmptyPasswords yes

※キー配列が英語だったため、: の場所に少し苦労

## 再起動
/etc/init.d/sshd restart

確認

## ubuntu環境から
ssh root@192.168.***.*** -p 22

<結果>
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

無事sshで接続完了しました。