sshdインストールつづき
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sudo su
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p /opt/env/srv/ssh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd /opt/env/srv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cp -p /usr/loca/etc/ssh/sshd_config.example ./ssh/sshd_config
|
|
|
|
|
|
|
|
|
|
|
cp -p /usr/loca/etc/ssh/ssh_config.example ./ssh/ssh_config
|
|
|
|
|
|
|
|
|
|
|
cp -p /usr/local/etc/ssh/ssh_host* ./ssh
|
|
|
|
|
|
|
|
|
|
|
|
|
sed -i 's/#Protocol 2/Protocol 2/g' ./ssh/sshd_config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo \#!/bin/sh>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo while \[ ! -e /usr/local/etc/ssh/ssh_config.example \]>>openssh.sh
|
|
|
|
|
|
|
|
|
|
echo do>>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo cat /dev/null>>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo done>>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo cp -p /opt/env/srv/ssh/\* /usr/local/etc/ssh/>>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
echo chmod 600 /usr/local/etc/ssh/ssh_host\*>>openssh.sh
|
|
←再起動すると、/mnt/sda1/opt/env/srv/ssh/ssh_host*のパーミッションが620になる
|
echo /usr/local/etc/init.d/openssh start>>openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
chmod 775 openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
とりあえず起動してみる
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
./openssh.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Teraterm
で入ってみる
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ユーザは先ほどのpeirtan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
永続化する
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo sh /opt/env/srv/openssh.sh >>bootlocal.sh
|
|
|
|
|
|
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![IF>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![ENDIF]>