1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IBM Cloud: ROKS(Red Hat OpenShift on IBM Cloud)のworker nodeにsshでログインできるように構成する

Last updated at Posted at 2021-10-18

1. SSHの構成

実際は、DaemonSetとかを作ればいいんだろうけど、その前の事前動作確認ということで。

node情報を取得
[root@new-syasuda-tok1-vpc1 ~]# oc get nodes -oname
node/10.0.0.25
node/10.1.0.17
debugコンテナでnodeにアクセス
[root@new-syasuda-tok1-vpc1 ~]# oc debug node/10.0.0.25
Creating debug namespace/openshift-debug-node-stfkg ...
Starting pod/100025-debug ...
To use host binaries, run `chroot /host`
Pod IP: 10.0.0.25
If you don't see a command prompt, try pressing enter.
sh-4.4# 
chrootでホスト環境に移動
sh-4.4# chroot /host
公開鍵を配置
sh-4.4# mkdir /root/.ssh
sh-4.2# vi /root/.ssh/authorized_keys
(公開鍵をコピーする)
sh-4.2# chmod 600 /root.ssh/authorized_keys
sshdを構成
sh-4.2# vi /etc/ssh/sshd_config
# PermitRootLogin no
PermitRootLogin yes
sh-4.2# systemctl restart sshd

2. テスト

[root@new-syasuda-tok1-vpc1 ~]# ssh 10.0.0.25
Authorized uses only. All activity may be monitored and reported.
Last login: Mon Oct 18 06:27:02 2021 from 10.0.0.4
[root@kube-c3j463dt0o165mnm7be0-privonlysya-default-000009a0 ~]#
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?