さくらVPS で WinSCP を ROOT で使う
VPS
VPS の設定で色々と参照しながらしている。
さくらのVPS講座
「 ネコでもわかる. httpサーバーApacheをインストールする」
では、CentOS7 で説明している。他のサイトでは CentOS8 での説明なので、
少し違いが有って、混乱してしまう。
1. httpサーバーApacheをインストールする の項で
ファイアウォールの設定を変更して、
# systemctl restart firewalld
ここまでできたら、試しにブラウザで確認する
http://xxx.xxx.xxx.xxx
(あなたのVPSのIPアドレス)
* 注意する http:// なので https:// では無い
# systemctl enable httpd
# systemctl list-unit-files -t service
httpd.service enabled と出る
自動起動が有効になっていない場合は”disabled“と成ります
SSHのFirewall設定
過去の経験から、上手く行かない場合では、どうもこの辺かなと思う。
sshd_config で
rootユーザーのログイン禁止
SSHのポート番号変更
と進む
ターミナルアプリケーションで
FirewallD is not running と成った場合 firewalldを起動させる
# systemctl start firewalld.service
# firewall-cmd --add-port=*****/tcp --zone=public
# systemctl start firewalld.service
# firewall-cmd --list-all
で確認
# firewall-cmd --add-port=*****/tcp --zone=public --permanent
# firewall-cmd --reload
# dnf install -y policycoreutils-python-utils
# semanage port --add --type ssh_port_t --proto tcp *****
# semanage port --list | grep ssh
# systemctl restart sshd
$ ssh -p ***** [USERNAME]@[HOSTNAME]
ターミナル操作を途中で切断しないで、ここまで一気に進めないと接続不可成ってしまう。
Let’s Encrypt 期限切れ
Let’s Encrypt のセットが不完全で、期限が切れる前の、登録しているメールアドレス宛に通知が有った。
取りあえず、以下のようにした。
Which names would you like to activate HTTPS for?
blank to select all options shown (Enter 'c' to cancel): 1
What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://******.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ここから
$
sudo
certbot certificates
$
sudo
certbot renew
などをしてみた。
確認して OK