Now, it works without Exception ValueError: No password or public key available!. MIIEpAIBAAKCAQEAuFSEXjLMwyAJ54d5hQQjyIE+4l5pZw7GuYFDgNCzXjl6CNwVĬopy it to my local mac, and test it. Now the ~/.ssh/id_rsa on my linux OS looks like: -BEGIN RSA PRIVATE KEY. Ssh-copy-id -i ~/.ssh/id_rsa.pub -p ssh_port I authorize access to the key with ssh-copy-id -i ~/.ssh/id_rsa.pub -p ssh_port. So, I generate a new key in a linux OS, with command of ssh-keygen -t rsa, then # raise SSHException: not a valid RSA private key file # id_rsa with `-BEGIN OPENSSH PRIVATE KEY-` The key is a, that means, the ~/.ssh/id_rsa should be convert to paramiko.pkey correctly. **Private** key file name (``str``) to obtain the public keyįrom or a **public** key (:class:``) According to the source code of sshtunnel model: ssh_pkey (str or paramiko.PKey): In fact, the ssh_pkey should be started with -BEGIN RSA PRIVATE KEY. In my case, my macOS ~/.ssh/id_rsa start with -BEGIN OPENSSH PRIVATE KEY- which is not the proper start line. What might be happening here? Am I misunderstanding something about the expected arguments for SSHTunnelForwarder? Something more fundamental about the key and password? This happens whether ssh_pkey is pointing to the public key or the private key. If I run the code without having already logged into the server at some point earlier, I receive this error: ValueError: No password or public key available! (But the password is there - ssh_private_key_password - no?) If I log into "my.server" separately and enter my private key password in the dialog for storage by ssh-agent, and then run the code above, it works as expected. Everything is working fine, except that sshtunnel doesn't seem to recognize my ssh_private_key_password unless I've already entered it elsewhere (or more likely I'm making a mistake when providing it). There are many more advanced uses of SSH Tunnels, but the above setup will create a general purpose strongly encrypted socks5 proxy to almost any host on the internet.I'm using sshtunnel to connect to connect to a remote server and on to a database from there. echo content of publick key > /.ssh/authorizedkey. This will be the port that you configure your browser and other programs to use, in order to forward their traffic via the SSH Tunnel.įor destination, in most cases you will want to just select "Dynamic", and hit "Add", and then "Add Host". Add Content of Public Key to authorizedkey in Your Local Machine. Next, we make a Tunnel on that Host by filling in the lower "Alias" box with another label, and selecting what local port the Tunnel will listen on. The settings used below are just an example. Then fill in your VPNSecure Username and Password. You need to fill in an Alias (Label) for the connection, and then get the Host and Port details for the server you want from our members area under "Servers". On the next screen, click the "Host" menu, and "Add Host". I personally have the whole program and its storage file on a flash drive, so I can use tunnels anywhere I go. The first screen will ask for a location and password for your "Encrypted Storage File", this will hold all of the settings, usernames and passwords for each SSH server you select. This guide will walk you through setup using "SSH Tunnel Manager" available here - Īfter downloading and extracting the zip file (Portable, No installation needed) you can run SSHTunnelManagerGUI.exe
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |