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.
Using SSH over WLAN
The SSH connection allows you to issue commands to the phone from your Ubuntu Terminal. Note that the default username in Sailfish OS is different in different versions of the OS. 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.
1. Make sure that both your PC and your Jolla are connected to the same WLAN network (SSID).
2. Check the WLAN IP address of your Jolla in Settings > System > Developer mode.
3. Create and save your SSH password on the same menu page.
4. Launch Linux Terminal app
In the next command, replace "uuuuu" with your real username.
ssh uuuuu@xxx.yyy.aaa.bbb ## apply your username
where xxx.yyy.aaa.bbb
is your WLAN IP address from step 2
6. Enter your SSH password
You are now in the phone system viewing directory $HOME.
Examples:
Check if there are any text files in the home directory and view their properties
ls -la *.txt
Using SCP over WLAN
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 "uuuuu" with the correct username which you get with the command.
1) Copy file "User-manual.txt" from Ubuntu to your phone, to the home directory:
scp User-manual.txt uuuuu@xxx.yyy.aaa.bbb:/home/uuuuu
2) Copy directory "Scripts" from Ubuntu to your phone, to directory "test":
scp -r Scripts uuuuu@xxx.yyy.aaa.bbb:/home/uuuuu/test
3) Copy file "journal.log" from your phone to Ubuntu (to the current directory):
scp uuuuu@xxx.yyy.aaa.bbb:/home/uuuuu/journal.log ./
4) Copy all ".log" files from a phone directory ( /var/log) to Ubuntu (to "some other directory"):
scp uuuuu@xxx.yyy.aaa.bbb:/var/log/*.log /some/other/directory