変奏現実

パソコンやMMORPGのことなどを思いつくまま・・・記載されている会社名・製品名・システム名などは、各社の商標、または登録商標です。

この画面は、簡易表示です

他接続

[Linux]Cockpit コンソールから他のコンソールに繋ぐ

KVMサーバーのCockpitのページから直接ブログサーバのCockpitに繋いでみた。

まずはSSH接続用の公開鍵を作る。

# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): [passphraseを入力] ※passphraseはログイン時に使用
Enter same passphrase again: [passphraseを入力]
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Fyfc0Do9Wux/6uZgjLvM9nCq4mYVaOphgip9bx8I1eE root@xxxxxxxx.xxxxxxxx.local
The key's randomart image is:
+---[RSA 3072]----+
|        . ..     |
|       o o o.    |
|      ..E ++o    |
|     .o . o+=    |
| .  .o  S..= .   |
|. . +. ....o.    |
|.. + .... o =.   |
|o . o =  +.* .o .|
|.  . *oooo*o.++o |
+----[SHA256]-----+

次にブログサーバのSSHの設定内容を取得

# ssh-keyscan -H 192.168.xxx.xxx >> ~/.ssh/known_hosts
# 192.168.xxx.xxx:22 SSH-2.0-OpenSSH_8.0
# 192.168.xxx.xxx:22 SSH-2.0-OpenSSH_8.0
# 192.168.xxx.xxx:22 SSH-2.0-OpenSSH_8.0

最後にブログサーバに公開鍵を送信

# ssh-copy-id root@192.168.xxx.xxx
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.xxx.xxx's password: [passwordを入力]

Number of key(s) added: 1

Cockpitの画面を開き、左上のサーバー名の右の▲をクリックして▼に変え、【新規ホストの追加】ボタンを押す。

ダイアログからIPアドレス、ユーザ名、パスフェーズを入力。

認証でSSHキーを選択、キーパスワードは先のパスフェーズを入力。

自動ログインは、/root/.ssh/id_rsa のパスワードを変更しますのチェックし、新しいパスワードを設定する。




top