Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8803627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:23:13+00:00 2026-06-14T01:23:13+00:00

I’d like to authorize user in CLI using web API in similar way the

  • 0

I’d like to authorize user in CLI using web API in similar way the SSH does it (uploading public key on server, and then using private key to authorize). Is it possible?

I don’t mean to generate public / private key par, but rather re-use existing id_rsa and id_rsa.pub.

Do you know any software packages that make it easier (preferably Ruby on Rails gems?)

@edit:

Specifically, I want to log in on website, upload and connect my public key with online account, and then be able to use website’s API (authentication) through CLI interface.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:23:15+00:00Added an answer on June 14, 2026 at 1:23 am

    You can use the openssl library. As far as a more complete solution for what you want, I don’t think it’s available. Should not be too much work to implement with the library though.

    http://ruby-doc.org/stdlib-1.9.2/libdoc/openssl/rdoc/OpenSSL/PKey/RSA.html

    Basically do something like:

    # private_key_str can be in PEM or DER format
    OpenSSL::PKey::RSA.new(private_key_str, 'passphrase').public_key
    

    And compare it to the public key. You can get a string representation of the key with #to_pem or #to_der depending on the format you use (play around with it a little). You can alternatively use the rsa library also.

    I think you can use

    ssh-keygen -e -f id_rsa.pub > pemkey.pub
    

    To convert from the default format of ssh-keygen to PEM. You can run this command on the server to make the conversion, if necessary – you’ll have to try and see to match the formats properly, since I’m not sure if OpenSSL::PKey::RSA accepts the default format of ssh-keygen. You can also make ssh-keygen read from STDIN and write to STDOUT so you don’t need to use files to do the conversion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.