scp-权限被拒绝(公钥)

scp-权限被拒绝(公钥)

我可以通过 ssh 连接到远程服务器

ssh -i "C:\Users\kong\Documents\prl.ppk" [email protected]

但无法 scp

scp -i "C:\Users\kong\Documents\prl.ppk" [email protected]:~/home_nfs/kong/script/train.py "./script"

但收到此消息

Load key "C:\\Users\\kong\\Documents\\prl.ppk": invalid format
Permission denied (publickey).

我该如何解决这个问题?这是我的 prl.ppk 文件。

PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20210426
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABJQAAAQEAliFI5IDLY4pOPuWhetezPDd7kgh5SeT9sWJq
J9QPnt6rKtzV+W+MABq7PujdwgYdg6ulfHRy+274vWc4Iv1fMd25pRA9dGsht91s
OaBdcw3tX8jEJ10OeLpm+7erROuSc6n5vlYuY5LD90RIB+MG3aoXOGKT+h3oMhr+
N3+mAKhXIEy272xisHOzsmTrPhAsMmoRNDZ1XhRiLm67SHv0HK9ZALxE6yL6TbtM
n2S8rZFtxRTl3QEa2CsmOqluGyybyFGIKrS92drmZOc4rF0oNLdzfoS01hKHD2EZ
Xls3UhK/URttzcIql/7v9tXvknoUZRj+VSbCJqzjiCK0/so8Xw==
Private-Lines: 14
AAABAEDrzH584lSO1bpVdkL1ffCGsfn105WTdJ+72uDKZ56lenNmal4GuRTNSg1d
x63ZIYUL9IjYaRLINDY6eSPjMBWQUEdg9/r95RE9J+GRdITHwJgfd2r3zugZQUpB
liukI6ejcuqGIeXeme5it11bQT1CokHlcGwom8Kj442e+61BNLZagidenfW6sKF2
37eHOt3xIGoOUuRDBeYTjG/6C2EUyCnv95FIO/njg4unXwy1iBt+oTtNl7j1c+Z2
SdoKUbk7YrHt5g0XDgK0GAYiR5P0WJPu+aV+RhJmjsL+9l3g+kGcf70huzNCEBTs
1kHTOz1qODHlbiHGHRbMS6wL3S0AAACBAOZ25ok3BxMLEOEzsZVCGPx8gOXWELhj
z9M7p9CcXKvtNmw/gq2vWXSQPtePOqlyO8Sw8i3IvjA6hcLuE92n/BqCNQarzYsm
zM2nT/TxyZJ7AAAAgQCmw7TgvVjCXSMaCVBwo459N6q6pVhY7smJ/AXpIYbvxjvm
a2RVcTPf3EX+WU6iJ3/nyLpj5WU5gqjfX5oiuKZrj3dOGS3hd8XCwv7wgdE2wVv6
aOll2AUQdJUXrDL0Jr636G9Yn6X5dvBn2F5ickWA5N5VtfaoUcXynBpRDyU6bQAA
AIEA5TZTUgV/2ZPWxsL74Wwrxuxq2UIpLx6sN7I7xjKjstJ/+JOZcy0+6Cem7pSc
SB2GtcBiAR5ehGkvQNqdvY9elDMC0hkxOkivOWIJh4CJdJzVtZhDiBzQApw1W2sF
5v1KMeT5qd3fzCMuYQL6qINvMPHvSizSY5f4FOBOVugK4xQ=
Private-MAC: 9beae1b5c93534406ee8feceace093bc8972728a

答案1

如果服务器运行 OpenSSH 服务器,则需要将密钥转换为 OpenSSH 可接受的格式。不接受 Putty 格式 (ppk)。

您可以在 PuTTYgen 工具中执行此操作。

相关内容