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

  • Home
  • SEARCH
  • 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 6981617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:10:49+00:00 2026-05-27T18:10:49+00:00

I am creating one user and want to set the ssh key for that

  • 0

I am creating one user and want to set the ssh key for that user

My script is

import paramiko

ssh_conn = paramiko.SSHClient()
ssh_conn.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_conn.load_system_host_keys()
ssh_conn.connect('localhost', username='test', password='test')

cmd = 'ssh-keygen -t dsa'

stdin, stdout, stderr = ssh_conn.exec_command(cmd)
stdin.write('\n')
stdin.flush()
stdin.write('\n')
stdin.flush()
stdin.write('\n')
stdin.flush()

print "Output: ", stdout.read()

But its seems not working

When i run it as single statement copy past on python console then it works but when i run it as single python script it hang at last line print "Output: ", stdout.read().

Thx in advance for your help 🙂

  • 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-05-27T18:10:50+00:00Added an answer on May 27, 2026 at 6:10 pm

    Before attempting to read the stdout issue:

    stdin.channel.shutdown_write()
    

    See also this question for reference.

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

Sidebar

Related Questions

I want the user to select one out of many elements. So I'm creating
I am creating a user input at one of the events: var throwConnectBox =
So I'm creating a django app that allows a user to add a new
I am creating a application using jmf that will be launched on a user's
i'm Creating an application that will be working off a User table, the user
I'm creating my own user control that can display n amount of images. Here
I am creating a script that will show your computer information in Non-Geekeese. This
I'm creating a form on a web page, but I want that form to
I'm creating a web application installer using WiX. I want to allow the user
In one form I am creating a territory and editing multiple users. The "user_attributes"

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.