2

I can't connect to my iphone via ssh. device is jailbroken and has openssh installed:

$ ssh -V
OpenSSH 6.7p1, OpenSSL 0.9.8zg 11 Jun 2015

I've found out that for some reason it doesn't have the server process started(my other post: Can't ssh to my iphone: ssh_exchange_identification: Connection closed by remote host)

Although I've run on my iphone(as root):

# launchctl load /Library/LaunchDaemons/com.openssh.sshd.plist

But

$ ps aux | grep [s]shd

returns nothing, instead of something like:

root 749 0.0 0.0 55164 5428 ? Ss Aug09 0:00 /usr/sbin/sshd -D

So there is the question:

How can I start my ssh server on my iphone?

And/Or

Verify a correct installation?

EDIT:

Well I got it!

so $(which sshd) returned me something like:

Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

So I've found this solution online: https://bbs.archlinux.org/viewtopic.php?id=165382

On my iphone I run:

$ su
# $(which ssh-keygen) -A
# $(which sshd)

and after that nmaped iphone from my laptop (to check if it worked):

sudo nmap -sS -sV -p 22 iphone.local
Starting Nmap 6.47 ( http://nmap.org ) at 2015-08-09 18:00 PDT
Nmap scan report for iphone.local (192.168.1.53)
Host is up (0.058s latency).
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 6.7 (protocol 2.0)
MAC Address: D8:BB:2C:83:F8:84 (Unknown)

DONE!

1

Try running sshd in the foreground to prove correct installation:

  1. Find it: which sshd
  2. Run it: sshd
  3. Report Output

You could try sshd | tee ~/ssh.out (if IOS has 'tee'), else sshd >> ~/ssh.out

  • how to write the output to the file? something like /usr/sbin/sshd | cat >> ~/ssh.out in iOS? – Drew Aug 10 '15 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.