Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不是直接的编程问题,而是某种相关的。JSch(Java SSH 库)似乎不允许 macOS 10.14 使用创建的私钥
$ ssh-keygen -t rsa -b 4096
我应该使用什么命令来创建具有这种格式的私钥文件:
-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,....
哪个被 JSch 接受?
您似乎需要经典 OpenSSH 格式的密钥。最新版本的 OpenSSH 以新格式生成密钥。
要强制使用经典格式,请使用-m PEMswitch。
-m PEM
使用 JSch 时,另请参阅“无效的私钥” 。