... | ... | @@ -116,65 +116,98 @@ That will show you your IMSI, among other pieces of information. |
|
|
## Tutorials
|
|
|
|
|
|
* Secure Shell (ssh)
|
|
|
Note that using the L5's passcode to log in remotely is relatively weak security. See related tutorials for better authentication solutions.
|
|
|
_Note that using the L5's passcode to log in remotely is relatively weak security. See related tutorials for better authentication solutions._
|
|
|
|
|
|
SECURE SHELL
|
|
|
Logging in remotely to the L5’s terminal in order to execute commands
|
|
|
|
|
|
On your computer (the client):
|
|
|
On your computer (the client):
|
|
|
|
|
|
sudo apt update && sudo apt upgrade
|
|
|
sudo apt install openssh-client
|
|
|
`sudo apt update && sudo apt upgrade`
|
|
|
`sudo apt install openssh-client`
|
|
|
|
|
|
On the Librem 5 (the remote device):
|
|
|
sudo apt update && sudo apt upgrade
|
|
|
sudo apt install openssh-server
|
|
|
On the Librem 5 (the remote device):
|
|
|
`sudo apt update && sudo apt upgrade`
|
|
|
`sudo apt install openssh-server`
|
|
|
|
|
|
Confirm that it worked (i.e. is “active”):
|
|
|
|
|
|
sudo systemctl status ssh
|
|
|
`sudo systemctl status ssh`
|
|
|
|
|
|
If not active:
|
|
|
|
|
|
sudo systemctl enable ssh
|
|
|
`sudo systemctl enable ssh`
|
|
|
|
|
|
If firewall blocks ssh on the remote device:
|
|
|
If firewall blocks `ssh` on the remote device:
|
|
|
|
|
|
sudo ufw allow ssh
|
|
|
`sudo ufw allow ssh`
|
|
|
|
|
|
Other firewall options available:
|
|
|
|
|
|
stop
|
|
|
`stop`
|
|
|
|
|
|
start
|
|
|
`start`
|
|
|
|
|
|
disable
|
|
|
`disable`
|
|
|
|
|
|
Determine IP address of the remote device (L5):
|
|
|
Determine IP address of the remote device (L5):
|
|
|
|
|
|
Available in the What IP app, or via the L5’s terminal:
|
|
|
Available in the `What IP` app, or via the L5’s terminal:
|
|
|
|
|
|
ip address or ifconfig
|
|
|
`ip address` or `ifconfig`
|
|
|
|
|
|
or log in to your router to find the L5’s IP address.
|
|
|
|
|
|
To log in over WiFi to the remote device (L5) from your computer:
|
|
|
To log in over WiFi to the remote device (L5) from your computer:
|
|
|
|
|
|
ssh username@REMOTE.IP.ADDRESS.HERE
|
|
|
`ssh username@REMOTE.IP.ADDRESS.HERE`
|
|
|
|
|
|
Example: ssh purism@192.168.1.xxx
|
|
|
Example: `ssh purism@192.168.xxx.xxx`
|
|
|
|
|
|
Type the word “yes” at the next terminal question, then provide the password to your L5. The following prompt will appear:
|
|
|
|
|
|
purism@pureos:~$
|
|
|
`purism@pureos:~$`
|
|
|
|
|
|
You are now logged into your L5 from your computer’s terminal, and can easily execute any terminal commands remotely. This also makes it easy to copy terminal output and paste it here in the forum or elsewhere.
|
|
|
|
|
|
You can also connect your L5 to your computer over USB and use ssh without WiFi. You will need to use your computer’s network settings to create a Shared Connection over ethernet (not described here).
|
|
|
You can also connect your L5 to your computer over USB and use `ssh` via a `Shared Connection` in your computer’s network settings.
|
|
|
|
|
|
In the settings panel of the L5, under Sharing, you should now see that Remote Login is On. At the top of this panel, you can use the toggle to disable or enable remote sharing as you wish.
|
|
|
In the settings panel of the L5, under `Sharing`, you should now see that Remote Login is `On`. At the top of this panel, you can use the toggle to enable or disable remote sharing for security purposes.
|
|
|
|
|
|
To exit ssh, use the command exit in the terminal.
|
|
|
To exit `ssh`, use the command `exit` in the terminal.
|
|
|
|
|
|
* SECURE COPY (scp)
|
|
|
~~~Note that using the L5's passcode to log in remotely is relatively weak security. See related tutorials for better authentication solutions.~~~ |
|
|
\ No newline at end of file |
|
|
|
|
|
Copying files and folders remotely between devices on your network
|
|
|
|
|
|
_Note that using the L5's passcode to log in remotely is relatively weak security. See related tutorials for better authentication solutions._
|
|
|
|
|
|
With `ssh` enabled, you can use the Secure Copy command (`scp`) to copy files or entire folders from the L5 to your computer, and vice versa. Note that in order to perform `scp`, you _do not_ log in to the L5 via `ssh` first.
|
|
|
|
|
|
The syntax is:
|
|
|
|
|
|
`scp remote_username@REMOTE.IP.ADDRESS.HERE:/remote/file.txt /local/directory`
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
`scp purism@192.168.xxx.xxx:/home/purism/example.txt /home/yourusername/Desktop` would copy the file example.txt located in the L5’s Home folder to the desktop of your computer.
|
|
|
|
|
|
`scp purism@192.168.xxx.xxx:/home/purism/Pictures/2021-04-12-example.png /home/yourusername/Desktop` would copy the image 2021-04-12-example.png located in the L5’s Pictures folder to the desktop of your computer.
|
|
|
|
|
|
To copy an entire folder from the L5 to your computer:
|
|
|
|
|
|
`scp -r purism@192.168.xxx.xxx:/home/purism/Pictures /home/yourusername/Desktop` will copy the folder “Pictures" from the L5 to your computer. (More convenient than copying individual images or files one at a time, in case there are many to copy.) The `-r` after `scp` stands for “recursive,” indicating that the copy action should continue until all is copied.
|
|
|
|
|
|
To copy a file from your computer to the L5, the syntax is:
|
|
|
|
|
|
`scp file.txt remote_username@REMOTE.IP.ADDRESS.HERE:/remote/directory`
|
|
|
|
|
|
If the file is not located in your computer’s Home directory, first change directory to the location of the file, using the command `cd`, for example `cd Desktop`, if the file is on your desktop, and so on.
|
|
|
|
|
|
Example, from your Home directory:
|
|
|
|
|
|
`scp example.txt purism@192.168.xxx.xxx:` (Use the actual ip address of your L5. This places the file in the L5’s Home directory.)
|
|
|
|
|
|
`scp example.txt purism@192.168.xxx.xxx:/home/purism/Documents` (This goes to the L5’s Documents folder.)
|
|
|
|
|
|
TIP: Although you perform `scp` without logging in to the other device with `ssh`, it may be helpful to use `ssh` first in order to list (`ls`) the contents of a folder so that it will be easy to copy and paste the name of a file or files for `scp`. Just be sure to exit `ssh` before you use `scp` or you’ll get an error. |