我收到以下错误,我认为这是由我的用户名有空格引起的 - 在这个例子中,我的名字是“用户名 Mark”
WARNING: Could not generate compute ssh key:
Public key file (/Users/username Mark/.ssh/google_compute_engine.pub) doesn't contain an OpenSSH public key. The key must consist of exactly three space separated parts.
ssh-rsa AAAAB3NzaC1yc2EAAAADAL3LiXbkjcIlHo9j5L5Sw/Tr0W+mYQBq0/cCCdD1FiiRHtPN9vt8ZJ+TxtnRzOvn040BQnLWwGzxWt2LaAHWISHQJqF6Cd7AHuN9eypzoF85vxKMKL3LgabR+Mcdj3LKoH4jOF/xx6PvfA74SDnl/8N username Mark@Marks-MBook-Air.local
我尝试将 google_compute_engine.pub 文件编辑为“用户名 Mark”@Marks-MBook-Air.local 但同样的错误。
然后我通过将用户名和主机添加到 ssh 配置文件来尝试解决方案,如此答案中突出显示的那样:OSX 上的 scp 不允许用户名中有空格?
我用了:
Host NBMark
User "username Mark"
Hostname Marks-MBook-Air.local
这让我更进一步,但随后产生了这个错误,表明它没有锻炼(IP 号码已更改):
Marks-MBook-Air:~ username Mark$ gcutil --service_version="v1beta14" --project="project-name" ssh --zone="europe-west1-a" "instance-test-2"
INFO: Updated project with new ssh key. It can take several minutes for the instance to pick up the key.
INFO: Waiting 300 seconds before attempting to connect.
INFO: Running command line: ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /Users/username Mark/.ssh/google_compute_engine -A -p 22 username Mark@5.35.208.77 --
Warning: Permanently added '5.35.208.77' (RSA) to the list of known hosts.
Permission denied (publickey).
是否有可能逃脱认证空间?
编辑 - 我最终设法通过使用本指南重命名我的短名称登录:http: //www.macworld.com/article/1132693/changeshortusername.html
你忠实的,马克