473,842 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

paramiko public key

i downloaded paramiko and was trying to create private/pub key pairs
from the docs, i use this method to create private key

import paramiko
k = paramiko.RSAKey .generate(1024)
k.write_private _key_file("test _priv")

How do i generate the public key for this ?

Dec 12 '06 #1
2 5173
ei***********@y ahoo.com wrote:

__str__ ?
Dec 12 '06 #2

hg wrote:
ei***********@y ahoo.com wrote:

__str__ ?
thanks for the tip
i done up a function to generate priv/pub key pairs like this

def keygen(bits,fil ,password=None) :
k = paramiko.RSAKey .generate(bits)
k.write_private _key_file(fil, password)
pk = paramiko.RSAKey (filename=fil)
o = open(pubk ,"w").write(pk. __str__())
Is this the correct way to do it ?

Dec 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: hanjar | last post by:
Hello, I'm using paramiko 0.9 to access one of my home machines and then execute a command. But with the script included below, the command gets executed on the 2nd to 6th go, never on the first. And the commands aren't that commplicated, they are usualy 'touch some-file' or 'cp some_file to /tmp/a'. Am I misunderstanding the paramiko's API or ... ?
by: dmorilha | last post by:
Hello all, I developed a solution using paramiko and a similar Telnetlib class to access a several number of network devices in replacement of using Pexpect library and openssh client. It worked so well but the bad performance made me think in how to improve Paramiko. Is there some way to do that, for example using some C extension or even other library? I would like to continue using Paramiko, but in production environment it could...
by: Tarun Kapoor | last post by:
I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. But when i try to connect using this script it fails .... **hostname, username and password are declared. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
by: washakie | last post by:
Hello, I'm trying to write a script which will allow me to initiate (spawn?) an SSH reverse tunnel from an internal box (inside a firewall) to an external box, while logged into the external box. I posted to another list and was pointed in the direction of paramiko. I've read the tutorials, but cannot seem to figure out exactly how I can do this... I'm hoping someone can look at what I'm trying to do below and provide an example... ...
by: Terry Reedy | last post by:
"Praveena B" <praveena_python@yahoo.comwrote in message news:808793.504.qm@web44809.mail.sp1.yahoo.com... when i used paramiko in python2.5 i got the error below. File "C:\praveena\python scripts\sshlib\ssh.py", line 5, in <module> import paramiko File "C:\Python25\Lib\site-packages\paramiko\__init__.py", line 69, in <module> from transport import randpool, SecurityOptions, Transport File...
by: sa6113 | last post by:
I use this code : hostname = "" username = "test" port = 22 password = '123456' # now connect try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
by: sa6113 | last post by:
I use this code : import paramiko import socket hostname = "" username = "test" port = 22 password = ''123456"
by: sa6113 | last post by:
I am using this code to connect to a windows machine using paramiko, I have installed sshd on the machine and it works properly: sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait() if not t.is_active(): print 'SSH negotiation failed.'
by: sa6113 | last post by:
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is it necessery ? or may I have to install another program? 2- I have entered server's Ip insted of hostname.Is it correct? 3- I have creat a user in server machine with a password to connect. Am I right?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.