sshtools | Java SSH tools - easier SSH & SFTP in Java | SSH Utils library
kandi X-RAY | sshtools Summary
kandi X-RAY | sshtools Summary
Java SSH tools - easier SSH & SFTP in Java. Sshtools is a wrapper around The goal is to make it easier to do SSH & SFTP in Java, as using Jsch can be a little tricky.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Runs SSH command
- Create a ssh session
- Creates a function that returns the connection of the given channel type
- Find all profiles
- Executes a SSH command
- Transforms the result into an SshCommand execution
- Sets the result of the execution
- Executes a list of commands
- Gets the command
- Entry point for the S SSH Server
- Execute a list of commands on the server
- Main method for testing
- Enable strict host key checking
- Executes a set of commands
- The main method
- Main entry point for testing
- Waits for the given condition to become true
sshtools Key Features
sshtools Examples and Code Snippets
Community Discussions
Trending Discussions on sshtools
QUESTION
I have used J2ssh library (0.2.7) to establish NETCONF connection in my application. While profile monitoring I noticed that few threads got blocked in disconnect() of j2ssh session. It is not a consistent issue, it happens at times.
I have given below the stack trace.
...ANSWER
Answered 2018-Sep-12 at 12:47You are using an SSH library that has not been maintained for 10 years. If this is a problem it will never be fixed.
For security reasons you should upgrade to the replacement library at https://github.com/sshtools/j2ssh-maverick
It's likely the problem will not exist in the new version, but at least if there is you can report an issue as the project is still active.
QUESTION
Is there a Java library/example to read an openssh format ecdsa public key to a JCE PublicKey
in Java? I want to use EC for JWT .
The format I'm trying to read is as per authorized_keys, or Github API (e.g. https://api.github.com/users/davidcarboni/keys): ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8hPtB72/sfYgNw1WTska2DNOJFx+QhUxuV6OLINSD2ty+6gxcM8yZrvMqWdMePGRb2cGh8L/0bGOk+64IQ/pM=
I've found this answer, which is fine for RSA and DSS: Using public key from authorized_keys with Java security, and this discussion of the openssh format for ECDSA: https://security.stackexchange.com/questions/129910/ecdsa-why-do-ssh-keygen-and-java-generated-public-keys-have-different-sizes
However I'm getting lost trying to adapt the RSS/DSA code for ECDSA - I'm not sure how to set up an ECPublicKeySpec
. It needs ECPoint
, EllipticCurve
, ECParameterSpec
, ECField
. The openssh format only contains two integers, which makes sense for ECPoint
, but I don't know how to set up the rest.
I've been poking around a bunch of libraries, including jsch, sshj, ssh-tools and good old Bouncycastle. The closest I have is:
com.jcraft.jsch.KeyPair load = com.jcraft.jsch.KeyPair.load(jsch, null, bytes[openSshKey]);
Which loads the key fine, but doesn't get me to a JCE PublicKey
- just a byte[] getPublicKeyBlob()
method.
Am I missing something obvious?
...ANSWER
Answered 2017-Jun-29 at 15:35I've found a way to do this using Bouncycastle (but would like to find a JCE way).
Adapting the code from Using public key from authorized_keys with Java security, and refering to RFC 5656, section 3.1, the following block added to decodePublicKey
will parse the single BigInt value Q, which is "the public key encoded from an elliptic curve point":
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sshtools
You can use sshtools like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the sshtools component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page