Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform Paramiko与谷歌云_Google Cloud Platform_Google Compute Engine_Putty_Paramiko - Fatal编程技术网

Google cloud platform Paramiko与谷歌云

Google cloud platform Paramiko与谷歌云,google-cloud-platform,google-compute-engine,putty,paramiko,Google Cloud Platform,Google Compute Engine,Putty,Paramiko,我正在尝试通过SSH Paramiko连接到Google云引擎。 我得到了这个信息: import paramiko k = paramiko.RSAKey.from_private_key_file("key_from_gcp/mykey.ppk") c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print "connecting" c.connect( hostname = "

我正在尝试通过SSH Paramiko连接到Google云引擎。 我得到了这个信息:

import paramiko
k = paramiko.RSAKey.from_private_key_file("key_from_gcp/mykey.ppk")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print "connecting"
c.connect( hostname = "123.05.5.5", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ]
for command in commands:
    print "Executing {}".format( command )
    stdin , stdout, stderr = c.exec_command(command)
    print stdout.read()
    print( "Errors")
    print stderr.read()
c.close()



resulted error is "paramiko.ssh_exception.SSHException: not a valid RSA private key file"
问题: 1) 如何将PPK文件更改为PEM文件? 2) 是否需要其他修复


请注意,PEM文件连接在AWS上运行良好。

如果要创建.PEM文件,请使用以下命令:

puttygen private_key.ppk -O private-openssh -o priv_p.pem