简体   繁体   中英

Access denied for 'none'. Trying to access a MySQL Workbench database via SSH using RStudio

The SSH key is a key file; there is no string-based password to the server. Both the SSH host and the MySQL database are on the same server. I need to SSH into the server (code below) then access the database. I've tried many different code snips and below is the furthest I've gotten.

My "best" code:

library(ssh)
session <- ssh_connect("user@host", keyfile = "<local path>", verbose = 2)
print(session)

This gives the error:

ssh_pki_import_privkey_base64: Trying to decode privkey passphrase=false
ssh_connect: libssh 0.8.6 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
ssh_socket_connect: Nonblocking connection socket: 13
ssh_connect: Socket connecting, now waiting for the callbacks to work
socket_callback_connected: Socket connection callback: 1 (0)
ssh_client_connection_callback: SSH server banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: Analyzing banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: We are talking to an OpenSSH client version: 7.4 (70400)
ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
ssh_kex_select_methods: Negotiated curve25519-sha256,ssh-ed25519,aes256-ctr,aes256-ctr,hmac-sha2-256,hmac-sha2-256,none,none,,
ssh_packet_dh_reply: Received SSH_KEXDH_REPLY
ssh_client_curve25519_reply: SSH_MSG_NEWKEYS sent
ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
ssh_packet_newkeys: Signature verified and valid
Found known server key: <...placeholder key data stuff...>
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey
ssh_packet_userauth_failure: Access denied for 'publickey'. Authentication that can continue: publickey
ssh_packet_userauth_failure: Access denied for 'publickey'. Authentication that can continue: publickey
Error: Authentication with ssh server failed

I got the same error because I tried to connect with my ed25519 key (using passphrase). After switching the connection properties to my RSA key (using passphrase) the connection went fine.

There is a reported issue here: can not connect via "Standard TCP/IP over SSH" using ed25519 key

A comment on that page says it works with ed25519 keys without passphrase but I haven't tested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM