не может ssh загрузить данные из экземпляра gcloud, на котором запущен centos6, чтобы получить резервную копию moodle из-за возможного взлома

У меня есть сервер moodle с лампами centos 6 в экземпляре vm gcloud, 2 дня назад пользователи сообщили о проблемах с доступом к moodle из-за ошибки подключения к базе данных.

вот что я обнаружил:

  1. перезапуск экземпляра не сработал, и это фактически вызывает проблему с apache, поскольку я не могу даже серверить html-страницы с сервера, хотя служба httpd запущена и перезапускается нормально.

  2. проверено apache и журналы безопасности, журналы, похоже, указывают на попытку взлома, и это моя вина и, возможно, причина, по которой это происходит.

Я полагаю, я бы попытался получить свои данные и начать все сначала на новом экземпляре, но когда Я пытаюсь подключиться по ssh к серверу (ssh web или gcloud ssh cli или filezilla), чтобы загрузить резервный zip-файл, который создается автоматически с помощью сценария, который я настроил, я вообще не могу использовать ssh, вот некоторые подробности:

  • в браузере ssh Я получаю эту ошибку:

    Ошибка: гостевая среда виртуальной машины устарела и только s поддерживает устаревший элемент метаданных sshKeys. Пожалуйста, следуйте инструкциям здесь, чтобы обновить

    , и хотя мне в конечном итоге предоставят доступ, я не могу ничего скачать через браузер.

  • на ssh gcloud cli я получаю эту ошибку:

    Permission denied (publickey, gssapi- keyex, gssapi-с микрофоном). ОШИБКА: (gcloud.compute.ssh) [/ usr / bin / ssh] завершился с кодом возврата [255].

ssh verbose показывает следующее:

MacBook-Pro:.ssh fcortes$ sudo gcloud compute ssh centos6 --ssh-flag="-vvv"
Password:
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname 34.66.109.207 is address
debug2: ssh_connect_direct
debug1: Connecting to 34.66.109.207 [34.66.109.207] port 22.
debug1: Connection established.
debug1: identity file /Users/fcortes/.ssh/google_compute_engine type 0
debug1: identity file /Users/fcortes/.ssh/google_compute_engine-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 34.66.109.207:22 as 'root'
debug1: using hostkeyalias: compute.8844278207473884047
debug3: hostkeys_foreach: reading file "/Users/fcortes/.ssh/google_compute_known_hosts"
debug3: record_hostkey: found key type RSA in file /Users/fcortes/.ssh/google_compute_known_hosts:1
debug3: load_hostkeys: loaded 1 keys from compute.8844278207473884047
debug3: order_hostkeyalgs: prefer hostkeyalgs: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: MACs ctos: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug3: send packet: type 34
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent
debug3: receive packet: type 31
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 1534/3072
debug3: send packet: type 32
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug3: receive packet: type 33
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:FtoD8qoSAeNtVsWukZ5YTbWIiApxpn2T+VsVzcF7SPE
debug1: using hostkeyalias: compute.8844278207473884047
debug3: hostkeys_foreach: reading file "/Users/fcortes/.ssh/google_compute_known_hosts"
debug3: record_hostkey: found key type RSA in file /Users/fcortes/.ssh/google_compute_known_hosts:1
debug3: load_hostkeys: loaded 1 keys from compute.8844278207473884047
debug1: Host 'compute.8844278207473884047' is known and matches the RSA host key.
debug1: Found key in /Users/fcortes/.ssh/google_compute_known_hosts:1
debug2: bits set: 1531/3072
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 4294967296 blocks
debug1: Will attempt key: /Users/fcortes/.ssh/google_compute_engine RSA SHA256:CxsVOSJsVd6lZxknFbIRRlzARrtvXpyOItST5IG6mVw explicit
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/fcortes/.ssh/google_compute_engine RSA SHA256:CxsVOSJsVd6lZxknFbIRRlzARrtvXpyOItST5IG6mVw explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
root@34.66.109.207: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

и в моем журнале консоли единственное, что я обнаружил, может быть К моей проблеме относится следующее:

Starting udev: udevd[351]: can not read '/etc/udev/rules.d/75-persistent-net-generator.rules'

udevd[351]: can not read '/etc/udev/rules.d/75-persistent-net-generator.rules'

но консоль gcloud показывает, что у меня есть настройки правил для http и ssh

https://prnt.sc/o241br

0
задан 26 September 2019 в 23:02
2 ответа

Поскольку здесь важны данные и согласно предложению Рика Свансона в группе facebook: Linux (RedHat / CentOS), rsync был решением для получения моих данных / резервных копий

Я делаю у меня есть тестовый сервер в цифровом океане, и после выполнения:

rysnc -avz [backup_path_on_gcloud]/backups digitalocean_user@[digital_ocean_server_ip]

мои резервные копии в gcloud были волшебным образом перенесены на мой тестовый сервер в цифровом океане теперь для восстановления резервной копии

0
ответ дан 23 November 2019 в 23:24

Если у вас возникли проблемы с подключением к вашему экземпляру виртуальной машины в GCP, вы можете попробовать одно из следующих действий:

  1. Устранение неполадок SSH . Вы можете проверить, применим ли один из описанных в этом документе сценариев к вашему случаю.
  2. Попробуйте подключиться к последовательной консоли . Вы должны включить его последовательную консоль, добавить свой открытый SSH-ключ в метаданные проекта или экземпляра и сохранить свой закрытый ключ на локальном компьютере, с которого вы хотите подключиться.
  3. Если по-прежнему нет возможности подключиться, вы можете взять диск, используемый экземпляром виртуальной машины, и подключить его к другой виртуальной машине в качестве вторичного диска . (пропустите «форматирование диска» в этом документе, так как он удалит все данные.)

Спасибо, что сообщили мне, был ли один из этих шагов успешным.

0
ответ дан 23 November 2019 в 23:24

Теги

Похожие вопросы