01-12-2011 05:46 PM
The release notes for Beta3 say a new feature is "secure connection: You can now connect to the tablet using Secure Shell (SSH) and upload and download files for your application using SCP and SFTP."
A vanilla install does not result in the simulator listening on port 22 (the standard for SSH) or any other port for SSH connections, either with or without development mode enabled.
I found the blackberry-connect program in the SDK bin folder, and tried the following after creating an RSA2 key:
c:\>blackberry-connect -targetHost 192.168.7.172 -devicePassword x PROGRESS: Connecting to target 192.168.7.172:4455 PROGRESS: Authenticating with target 192.168.7.172:4455 PROGRESS: Encryption parameters verified PROGRESS: Authenticating with target credentials. PROGRESS: Successfully authenticated with target credentials. PROGRESS: Sending ssh key to target 192.168.7.172:4455 Connection refused: Invalid ssh key contents. The target actively refused the connection. Please ensure that qconnDoor is running on the target. PROGRESS: Unable to send ssh key to target
The .ssh/id_rsa.pub file was generated as an SSH-1 key using PuttyGen. I also tried an SSH-2 RSA file with the same results.
The fact that it says it "succesfully authenticated" suggests it successfully connected... probably using port 443 (https) the way I assume the blackberry-deploy program does. However after that it appears to say my key is invalid (not sure I believe that), but also that the target "actively refused the connection" (I believe that... qconn is not listening on port 8000 or any other).
Anyone have knowledge of this area, or wild guesses I can try?
Solved! Go to Solution.
01-12-2011 06:21 PM
@taylortbb posted in the general beta 3 simulator thread, noting that qconn is in fact listening, just on port 4455. I should have seen that from the ":4455" part in the output I showed above.
I realized just after I posted (but was heading up for supper) that my issue is probably that PuTTY saved the key in a Windows format rather than a more standard or at least Posix-y format.
QNX would of course not be happy with the Windows format... maybe that's the issue. I'll try converting.
01-12-2011 06:49 PM
Okay, I'm able to connect using SSH. It's a bit convoluted at the moment but I'll simplify and post a recipe as soon as I can.
For anyone technical enough to follow with minimal direction:
This transfers the public key into the device by connecting through qconn (port 4455) using unknown protocols. The output looks like this:
PROGRESS: Connecting to target 192.168.7.172:4455 PROGRESS: Authenticating with target 192.168.7.172:4455 PROGRESS: Encryption parameters verified PROGRESS: Authenticating with target credentials. PROGRESS: Successfully authenticated with target credentials. PROGRESS: Sending ssh key to target 192.168.7.172:4455 PROGRESS: ssh key successfully transfered. PROGRESS: Succesfully Connected
The blackberry-connect program stays running, and as long as it's running at this point the simulator will be listening for SSH connections on port 22.
At this point, I had to take the test_rsa file (the private key) and import it into Puttygen using the Conversions -> Import Key menu. Then Save private key and load that key into Pageant.
Finally, connect normally using PuTTY to the SIMIP address, and log in as "devuser". This was discovered by looking in the /accounts folder using a primitive file browser app, where I found two subfolders, 1000/ and devuser/.
01-12-2011 06:57 PM
Added info about connecting with SSH. The blackberry-connect program (or, rather, whatever it talks to on the simulator side) installs your public key in /accounts/devuser/.ssh/authorized_keys2 with a "from" restriction, using the IP address of the machine on which you ran blackberry-connect.
This means you won't be able to connect from any other machine unless you edit that file (and you'd have to connect first from the blackberry-connect machine, and modify the file from there) either to remove that restriction or to add a second entry (could be using a different key) for the other machine. I've verified that the former approach works, as I'd like to be able to connect (for automated testing) from a Linux machine even though I'm running my dev tools on Windows.
01-12-2011 06:57 PM - last edited on 01-12-2011 07:09 PM
EDIT: Ignore this post. In the time it took me to write it, the two posts above me were made... Worked like a charm Peter (I'm on OSX, so no copying or converting keys, same for Linux).
------------------
Here's how far I was able to get (after generating a 4096-bit RSA keypair with ssh-keygen):
Cheers,
Ken
01-12-2011 09:33 PM
That is very impressive Peter you figure it out without any docs - I was about to write it...
You need 4096 RSA key. And login is "devuser" indeed.
And all the instructions above are valid, expect keys on windows.
For windows you can use putty to generate them
01-12-2011 10:51 PM
peter9477 wrote:
Okay, I'm able to connect using SSH. It's a bit convoluted at the moment but I'll simplify and post a recipe as soon as I can.
Dude, you're good
01-12-2011 11:02 PM
p3pp3r wrote:
Dude, you're good
Yeah, no kidding... ![]()
That is not my area of expertise so I am impressed.
01-13-2011 07:14 AM - last edited on 01-13-2011 07:16 AM
Hi,
I managed to connect and to start ssh (on my MacBook), but I can't read or write any files. The attempts come back with "cannot execute - No such file or directory". About all that works is cd, ls, and pwd.
EDIT: ignore this - silly me trying to transfer data using ssh instead of sftp
Harry
01-13-2011 12:17 PM
Hi,
I don't success to acces to the appData. I have my application and I would like to add image into .appData/MyApp/Local Store like on the old simulator.
But I have "access denied" the the appData folder.
I use WinSCP. But I haven't acces with putty in ssh to.
Any idea?
Thanks