SSH and SCP connections over USB from Ubuntu to your Sailfish device

Jolla Care -

The following instructions apply to the recent Ubuntu versions (14.04 and later).
This help article is for Linux/Ubuntu -- if you use a Windows computer then read this article.

 

Pre-requisite

You must unlock the device lock and the encryption of your phone with the security code before you can make an SSH connection to the phone. See these articles: device lock and encryption.

 

USB connection

Make sure you have the Developer mode enabled on your Sailfish device. If not, see this article.
Check that you have the SSH password set in "Settings > Developer tools > Remote connection".

Connect a USB cable between your PC and your Sailfish device. At the moment of connection, choose "Developer mode" at the device display.

 

SSH session

Open the Terminal on Ubuntu. Note the different usernames depending on the Sailfish OS version on your phone. On 3.4.0 or later, there are two possible usernames, nemo and defaultuser. Only the correct one works. You can check it from the prompt of the Terminal app on the phone or with the command below (before getting root rights).

echo $USER

It replies either nemo or defaultuser. If you should get root then do exit first and try again.

 

Create the SSH connection with the correct command (matching your username):

ssh defaultuser@192.168.2.15    ## Sailfish OS 3.4.0 or later
ssh nemo@192.168.2.15


ssh nemo@192.168.2.15 ## Sailfish OS 3.3.0 or earlier
## (can appear on recent OS versions, too)

Type your SSH password now.

 

Troubleshooting

If the connection attempt fails, disconnect the phone from the PC. Restart the phone (consider restarting the PC, too).  Try again.

 

Using SCP over USB

The SCP connection allows you to transfer files between your phone and your Ubuntu computer.

Prepare the connection in the same way as in steps 1 to 4 above. Then type the commands to copy files between the two devices.

Examples:

In all of the examples below, replace the string "UUUU" with the correct username:
- defaultuser      (in case of Sailfish OS 3.4.0 or later)
- nemo               (in case of 3.3.0 or earlier)

1) Copy file "User-manual.txt" from Ubuntu to your phone, to the home directory:

scp  User-manual.txt  UUUU@xxx.yyy.aaa.bbb:/home/UUUU

2) Copy directory "Scripts" from Ubuntu to your phone, to directory "test":

scp  -r Scripts  UUUU@xxx.yyy.aaa.bbb:/home/UUUU/test 

3) Copy file "journal.log" from your phone to Ubuntu (to the current directory):

scp  UUUU@xxx.yyy.aaa.bbb:/home/UUUU/journal.log ./

4) Copy all ".log" files from a phone directory ( /var/log) to Ubuntu (to "some other directory"):

scp  UUUU@xxx.yyy.aaa.bbb:/var/log/*.log /some/other/directory

 

Have more questions? Submit a request
Powered by Zendesk