Comments (16)
I found that 512-bit RSA works, while 2048-bit RSA fails.
from rtop.
Do DecryptPEMBlock()
like this after pem.Decode()
https://golang.org/src/crypto/x509/pem_decrypt_test.go#L15
Also, use IsEncryptedPEMBlock()
to determine if decryption is needed.
from rtop.
Same as #13. Repeating what I posted there, could you try this?
Hmm, maybe it is picking up the key file auth method first, before the ssh-agent method. Can you try an experiment please?
- comment out line 118 in sshhelper.go: auths = addPasswordAuth(auths)
- recompile (make)
- try again?
from rtop.
I have the same error. I tried commenting out line 118 and recompiled and it didn't solve the problem.
I'm on OSX.
from rtop.
By the way, I encountered that error with and without the -i
flag.
from rtop.
Commenting out line 118 does not work for me, either running rtop without ssh-agent.
I think it fails at ans1.Unmarshal()
in ParsePKCS1PrivateKey
https://golang.org/src/crypto/x509/pkcs1.go?h=ParsePKCS1PrivateKey#L41
from rtop.
#11 (comment) is not correct. It is not 2048-bit RSA that fails, it is a key-pair with passphrase that fails.
from rtop.
Please check with commit f753d19. With this rtop will natively support encrypted private keys, and also support auth via ssh-agent correctly.
from rtop.
Building this version, now I no longer get that same error @Lance0312 got. But instead I get a "Key passphrase:" prompt
:~/dev/GO/rtop (master=)$ ./rtop [email protected]
Key passphrase:
^C
This works though without prompting me for a passphrase:
:~/dev/GO/rtop (master=)$ ssh [email protected]
from rtop.
@peterbe is your ~/.ssh/id_rsa encrypted?
from rtop.
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,4AD650ED3EC480B5....
........
from rtop.
so, plain text I guess
from rtop.
@mdevan, f753d19 works great. I was working on to build something like getpass()
, didn't know passwordCallback()
could simply do the job ;D
I think @peterbe uses ssh-agent, am I correct? The auth order changed in f753d19 breaks how it should work. If ssh-agent has credentials cached, it should be used for auth first. Then asks user for passphrase if there's no credential cached.
from rtop.
@Lance0312 There is a catch in the auth order. The code in golang.org/x/crypto/ssh/client_auth.go#clientAuthenticate
assumes that there is only one callback per auth type (e.g. "publickey"). So as it stands, either the agent or the key would work, but not both (as a superset). Will fix soon.
from rtop.
@mdevan, got it. I am closing this issue since we have encrypted key pair support now. @peterbe, would you please open another issue for your problem?
from rtop.
Try with the latest commit ba5b35e. This improves the auth method handling.
from rtop.
Related Issues (20)
- unable to monitor server, error message not helpful. HOT 16
- Could you upload a release? thanks! HOT 1
- LVM partitions not listed HOT 4
- [OS X] rtop: asn1: structure error: length too large HOT 9
- Why not use flag package for argument parsing? HOT 1
- error when using encrypted private key HOT 3
- Unreadable when light theme HOT 1
- Replace previous data HOT 4
- Question - Wondering if anyone knows it this works on the RaspberryPi 2 HOT 4
- push, instead of pull HOT 2
- not using ssh agent on MacOS HOT 3
- ssh: must specify HostKeyCallback HOT 3
- Json Output Option HOT 1
- Problem installing HOT 1
- Support for ZFS filesystems? HOT 1
- Memory Leak?
- Does't (yet?) support encrypted keys HOT 1
- Doesn't support SSH aliases
- Supporting ssh multiplexing
- PopOS (Ubuntu 21) install failing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtop.