maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [Solved] Unable to connect to Jolla phone via SSH (wifi) (https://talk.maemo.org/showthread.php?t=96633)

gsalone 2016-04-11 19:20

[Solved] Unable to connect to Jolla phone via SSH (wifi)
 
Tried via WinSCP, and Putty, neither work.
Don't remember installing anything, and it was working some time ago, but now not. Instead I get message "Network error: Connection timed out".

I got Sailfish 2.0.0.10.
Any ideas?

pichlo 2016-04-11 19:35

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by gsalone (Post 1503316)
Any ideas?

Millions. Did you double- and triple-check your IP address? Are you even on the same network? That is quite common in the corporate environment, employees' mobile devices are on different networks.

Did you disable and re-enable developer mode in the meantime? It shoul not happen but it has happened to me at least once: disabling and re-enabling dev mode reset the password and I had to set it again. Though in such a case I would expect a different error than 'network timeout'.

gsalone 2016-04-11 19:42

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by pichlo (Post 1503317)
Millions. Did you double- and triple-check your IP address? Are you even on the same network? That is quite common in the corporate environment, employees' mobile devices are on different networks.

Did you disable and re-enable developer mode in the meantime? It shoul not happen but it has happened to me at least once: disabling and re-enabling dev mode reset the password and I had to set it again. Though in such a case I would expect a different error than 'network timeout'.

Yes to all unfortunately... tried all of the above and multiple times and restarting the device in between.

jellyroll 2016-04-11 19:46

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Go to developer mode en set your ssh password and try to connect while keeping the developermode window open. I do face the same error when i'm on a windows system.

gsalone 2016-04-11 19:48

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by jellyroll (Post 1503320)
Do you use SFOS on a N5?

Nope. Jolla phone.

Feathers McGraw 2016-04-11 20:31

Re: Unable to connect to Jolla phone via SSH (wifi)
 
This happens to services sometimes when they fail to start properly. If you've changed any ssh settings it could be an error in your configuration file. What is the output of:

Code:

sudo systemctl status sshd
?

jellyroll 2016-04-11 20:37

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Gsalone, answer McGraw.

gsalone 2016-04-11 20:55

Re: Unable to connect to Jolla phone via SSH (wifi)
 
1 Attachment(s)
Quote:

Originally Posted by Feathers McGraw (Post 1503327)
This happens to services sometimes when they fail to start properly. If you've changed any ssh settings it could be an error in your configuration file. What is the output of:

Code:

sudo systemctl status sshd
?

I executed
Code:

systemctl status sshd
(sudo is not recognized), output in attached photo.

gsalone 2016-04-11 20:56

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by jellyroll (Post 1503320)
Go to developer mode en set your ssh password and try to connect while keeping the developermode window open. I do face the same error when i'm on a windows system.

I did that too, not working either.

Feathers McGraw 2016-04-11 21:03

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by gsalone (Post 1503331)
I executed
Code:

systemctl status sshd
(sudo is not recognized), output in attached photo.

Sorry, I forgot I installed sudo myself because it's so ingrained in my habits, I meant devel-su!

Looks like it failed to start, let's see why:

Code:

devel-su journalctl -u sshd

gsalone 2016-04-11 21:07

Re: Unable to connect to Jolla phone via SSH (wifi)
 
1 Attachment(s)
Quote:

Originally Posted by Feathers McGraw (Post 1503333)
Sorry, I forgot I installed sudo myself because it's so ingrained in my habits, I meant devel-su!

Looks like it failed to start, let's see why:

Code:

devel-su journalctl -u sshd

There you go:

Feathers McGraw 2016-04-11 21:15

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by gsalone (Post 1503334)
There you go:

Can you post text please? You can copy and paste from fingerterm. Also look through for errors yourself, you can navigate the output like less, space moves forward a page.

You could also append -p err to the command to only show errors and worse, but sometimes the notices and warnings are useful for context.

jellyroll 2016-04-11 21:16

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by gsalone (Post 1503334)
There you go:

Thanks Gsalone.

gsalone 2016-04-11 21:29

Re: Unable to connect to Jolla phone via SSH (wifi)
 
1 Attachment(s)
Quote:

Originally Posted by Feathers McGraw (Post 1503337)
Can you post text please? You can copy and paste from fingerterm. Also look through for errors yourself, you can navigate the output like less, space moves forward a page.

You could also append -p err to the command to only show errors and worse, but sometimes the notices and warnings are useful for context.

These lines are all it is as output to this command. Maybe landscape helps a bit more?

Code:

-- Logs begin at Mon 2016-04-11 22:15:57 EEST, end at Tue 2016-04-12 00:24:55 EEST. --
Apr 11 23:04:30 Jolla systemd[1]: Starting OpenSSH server daemon...
Apr 11 23:04:30 Jolla systemd[1]: Started OpenSSH server daemon.
Apr 11 23:04:30 Jolla sshd[13326]: Server listening on 0.0.0.0 port 22.
Apr 11 23:04:30 Jolla sshd[13326]: Server listening on :: port 22.
Apr 11 23:04:44 Jolla systemd[1]: Stopping OpenSSH server daemon...
Apr 11 23:04:44 Jolla systemd[1]: sshd.service: main process exited, code=exited, stat
Apr 11 23:04:44 Jolla systemd[1]: Stopped OpenSSH server daemon.
Apr 11 23:04:44 Jolla systemd[1]: Unit sshd.service entered failed state.
~
[nemo@Jolla ~]$


Feathers McGraw 2016-04-11 21:40

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Hmm. Try starting it manually, see if you get any useful errors:

Code:

devel-su systemctl start sshd

Feathers McGraw 2016-04-11 21:42

Re: Unable to connect to Jolla phone via SSH (wifi)
 
BTW, in fingerterm you can use dragmode: select and then the copy/paste using thw buttons in the top right.

gsalone 2016-04-11 21:51

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by Feathers McGraw (Post 1503341)
Hmm. Try starting it manually, see if you get any useful errors:

Code:

devel-su systemctl start sshd

Code:

[root@Jolla nemo]# systemctl start ssd
Failed to issue method call: Unit ssd.service failed to load: No such file or director
y.


Feathers McGraw 2016-04-11 22:12

Re: Unable to connect to Jolla phone via SSH (wifi)
 
sshd not ssd!

gsalone 2016-04-11 22:18

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Yes sorry.
Did that, no error message shown, but still not possible to connect.

The journalctl command now shows this:

Code:

Logs begin at Mon 2016-04-11 22:15:57 EEST, end at Tue 2016-04-12 01:18:50 EEST. --
Apr 11 23:04:30 Jolla systemd[1]: Starting OpenSSH server daemon...
Apr 11 23:04:30 Jolla systemd[1]: Started OpenSSH server daemon.
Apr 11 23:04:30 Jolla sshd[13326]: Server listening on 0.0.0.0 port 22.
Apr 11 23:04:30 Jolla sshd[13326]: Server listening on :: port 22.
Apr 11 23:04:44 Jolla systemd[1]: Stopping OpenSSH server daemon...
Apr 11 23:04:44 Jolla systemd[1]: sshd.service: main process exited, code=exited, stat
Apr 11 23:04:44 Jolla systemd[1]: Stopped OpenSSH server daemon.
Apr 11 23:04:44 Jolla systemd[1]: Unit sshd.service entered failed state.
Apr 12 01:17:22 Jolla systemd[1]: Starting OpenSSH server daemon...
Apr 12 01:17:23 Jolla systemd[1]: Started OpenSSH server daemon.
Apr 12 01:17:23 Jolla sshd[18423]: Server listening on 0.0.0.0 port 22.
Apr 12 01:17:23 Jolla sshd[18423]: Server listening on :: port 22.
Apr 12 01:17:58 Jolla systemd[1]: Started OpenSSH server daemon.


Fellfrosch 2016-04-12 05:44

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Have you tried the following procedure:
Disable developer mode
Reboot your Jolla
Enable developer mode
Set new password
try to connect

gsalone 2016-04-12 16:05

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by Fellfrosch (Post 1503350)
Have you tried the following procedure:
Disable developer mode
Reboot your Jolla
Enable developer mode
Set new password
try to connect

Yes. Nothing.

Feathers McGraw 2016-04-12 17:07

Re: Unable to connect to Jolla phone via SSH (wifi)
 
I still think it's probably a configuration error (you didn't say whether you have been changing the config?)

Try starting sshd in test mode:

Code:

devel-su sshd -t
I got two lines about not being able to read ssh_host_ecdsa_key and ssh_host_ed25519_key, so ignore those (mine works). Anything else?

Sam

gsalone 2016-04-12 17:29

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by Feathers McGraw (Post 1503398)
I still think it's probably a configuration error (you didn't say whether you have been changing the config?)

Try starting sshd in test mode:

Code:

devel-su sshd -t
I got two lines about not being able to read ssh_host_ecdsa_key and ssh_host_ed25519_key, so ignore those (mine works). Anything else?

Sam

I have not changed any config, at least not to my knowledge. If something has been broken by something else, I do not really know.

Ironically, after this command, I get no extra lines, no message or warning. But still not working. :mad:

Feathers McGraw 2016-04-12 18:01

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Try removing and reinstalling sshd:

Code:

pkcon remove sshd
Code:

pkcon install sshd
If it's a dependency of the UI we can try reinstalling with zypper, or just removing /etc/ssh and letting the program generate anew config file.

Feathers McGraw 2016-04-12 18:05

Re: Unable to connect to Jolla phone via SSH (wifi)
 
sorry, the package name is openssh-server

bit slow today!

gsalone 2016-04-12 18:17

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Nothing...
I still get "Network error: Connection timed out" from Putty.

Could you share your config file? Maybe if i replaced it, it will work?

Feathers McGraw 2016-04-12 18:27

Re: Unable to connect to Jolla phone via SSH (wifi)
 
I've turned off password auth, so that won't work unless you have publickeys added to your ~/.ssh/authorized_keys

Did you try removing /etc/ssh?

jellyroll 2016-04-12 18:27

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by gsalone (Post 1503404)
Nothing...
I still get "Network error: Connection timed out" from Putty.

Could you share your config file? Maybe if i replaced it, it will work?

Can you connect by using the USB cable.

gsalone 2016-04-12 19:12

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by Feathers McGraw (Post 1503406)
I've turned off password auth, so that won't work unless you have publickeys added to your ~/.ssh/authorized_keys

Did you try removing /etc/ssh?

Yes, totally deleted. No changes. Do I need to uninstall and reinstall the opensshd now to recreate those folders? They are not recreated when i activate developer tools.

gsalone 2016-04-12 19:13

Re: Unable to connect to Jolla phone via SSH (wifi)
 
Quote:

Originally Posted by jellyroll (Post 1503407)
Can you connect by using the USB cable.

Yes, at least this one works :)

Fellfrosch 2016-04-12 19:19

Re: Unable to connect to Jolla phone via SSH (wifi)
 
If you are able to connect via USB it's very unlikely that it's the fault of your config files. But to be honest, if you are really in the same network and use the correct ip, I have not really a clue what can be wrong.

Are you sure it's the fault of your Jolla? Have you already tried to reset the authentication keys?

mrsellout 2016-04-12 19:26

Re: Unable to connect to Jolla phone via SSH (wifi)
 
I assume you can at least ping the Jolla and get a response.

gsalone 2016-04-12 19:35

Re: Unable to connect to Jolla phone via SSH (wifi)
 
How to reset authentication keys? I deleted whole ssh folder, and have not set a password for ssh, if this is what you mean.

In meantime, i ran again pkcon remove and then install for the openssh-server, the etc/ssh folder has been recreated, but still not possible to connect.

So i just restarted my router... guess what.. it works!

Thank you all for your support and efforts! Solution was literally under our nose :)

Fellfrosch 2016-04-12 21:22

Re: [Solved] Unable to connect to Jolla phone via SSH (wifi)
 
I got that. But maybe it's not just the fault of your jolla, but there is a problem that something in your network or your Jolla has has changed, and for that reason there was created a new key.

In that case you have to delete the key on your PC, because there is already stored a key for your Jolla and if that for some reason doesn't fit anymore, there is no connection possible.

If you delete this key on your PC, it should ask you on the next connection if you trust that key and if it should be stored. If I got it right, you are on Windows and use Winscp. As far as I know there is somewhere an option for deleting the keys - don't know that for sure, I'm on Linux.

The best way to exclude a key problem is to use another computer, which wasn't connected to your Jolla yet.


All times are GMT. The time now is 23:36.

vBulletin® Version 3.8.8