Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
project:single_boards [2016/05/25 22:43] over23 [Project][Active][single_boards] : restore and backup SD card [defined for mac, but apply for linux simillary |
project:single_boards [2019/07/17 04:54] (current) over23 [MacOSX install of Banana PI] |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| |**Interested:** | peterbay, [[user:overdrive|Overdrive]]| | |**Interested:** | peterbay, [[user:overdrive|Overdrive]]| | ||
| |**Related:**| | | |**Related:**| | | ||
| + | |**Reference:**| https://en.wikipedia.org/wiki/Banana_Pi | | ||
| | **License:** | [[https://creativecommons.org/licenses/by-sa/3.0/|Uveďte původ-Zachovejte licenci; CC BY-SA]] | | | **License:** | [[https://creativecommons.org/licenses/by-sa/3.0/|Uveďte původ-Zachovejte licenci; CC BY-SA]] | | ||
| {{ project:picka_small.jpg?300}} | {{ project:picka_small.jpg?300}} | ||
| Line 54: | Line 55: | ||
| * use nmap to find where you have Picka [or you can try to find it as next to bridge ip] | * use nmap to find where you have Picka [or you can try to find it as next to bridge ip] | ||
| + | * Scan for every TCP and UDP open port: | ||
| + | <code> | ||
| + | sudo nmap -n -PN -sT -sU -p- remote_host | ||
| + | </code> | ||
| <code> | <code> | ||
| SemioTex:Picka pavouk$ nmap 192.168.2.* | SemioTex:Picka pavouk$ nmap 192.168.2.* | ||
| + | ### more extensive nmap: nmap -p0- -v -A -T4 192.168.1.* | ||
| Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-13 14:47 CET | Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-13 14:47 CET | ||
| Nmap scan report for 192.168.2.2 | Nmap scan report for 192.168.2.2 | ||
| Line 87: | Line 92: | ||
| sudo dd if=/dev/disk4 bs=1m | gzip > ~/1_Labka/banana_picka_25.5.2016.img.gz | sudo dd if=/dev/disk4 bs=1m | gzip > ~/1_Labka/banana_picka_25.5.2016.img.gz | ||
| </code> | </code> | ||
| + | ====== example how to copy backup by scp ====== | ||
| + | ======= copy to remote host ======= | ||
| + | |||
| + | <code>scp ~/1_Labka/banana_picka_25.5.2016.img.gz user@remotehost:/home/share/Picky_Backup/</code> | ||
| + | |||
| + | ======= copy to localhost ======= | ||
| + | <code>scp your_username@remotehost:/home/share/Picky_Backup/banana_picka_25.5.2016.img.gz /some/local/directory</code> | ||
| + | |||
| + | |||
| ====== Restore ====== | ====== Restore ====== | ||
| * **remember, SD card should be unmounted** | * **remember, SD card should be unmounted** | ||
| <code> | <code> | ||
| - | # first check where SD card is mounted by | + | # first check where SD card is visible, but not mounted by |
| diskutil list | diskutil list | ||
| - | # lets it be again /dev/disk4 | + | # let it be again /dev/disk4 |
| gzip -dc ~/1_Labka/banana_picka_25.5.2016.img.gz | sudo dd of=/dev/disk4 bs=1m | gzip -dc ~/1_Labka/banana_picka_25.5.2016.img.gz | sudo dd of=/dev/disk4 bs=1m | ||
| </code> | </code> | ||
| Line 109: | Line 123: | ||
| touch ~/.ssh/authorized_keys | touch ~/.ssh/authorized_keys | ||
| chmod 600 ~/.ssh/authorized_keys | chmod 600 ~/.ssh/authorized_keys | ||
| + | |||
| + | ==== example of generating key to non standard position ==== | ||
| + | |||
| + | <code> | ||
| + | over@darkstar>mkdir ~/ssh_tmp | ||
| + | ssh-keygen -t rsa -C "tpetru@gmail.com" -f ~/ssh_tmp/id_rsa_na_jine_misto | ||
| + | Generating public/private rsa key pair. | ||
| + | Enter passphrase (empty for no passphrase): | ||
| + | Enter same passphrase again: | ||
| + | Your identification has been saved in /home/over/ssh_tmp/id_rsa_na_jine_misto | ||
| + | Your public key has been saved in /home/over/ssh_tmp/id_rsa_na_jine_misto.pub. | ||
| + | The key fingerprint is: | ||
| + | SHA256:hriECJShFg+8AKVHVkoqYtBknvhf/sGW+KQr4wqtEUE tpetru@gmail.com | ||
| + | The key's randomart image is: | ||
| + | +---[RSA 2048]----+ | ||
| + | |=EX.. | | ||
| + | |*%=o | | ||
| + | |@o*. | | ||
| + | |** . . . | | ||
| + | |o o o o S | | ||
| + | | o o + + . | | ||
| + | |o . o o * | | ||
| + | | + o * . | | ||
| + | |. .o.oo.o | | ||
| + | +----[SHA256]-----+ | ||
| + | </code> | ||
| + | |||
| + | |||
| nano ~/.ssh/authorized_keys <--- copy there public key generated somewhere | nano ~/.ssh/authorized_keys <--- copy there public key generated somewhere | ||
| Line 128: | Line 170: | ||
| when able to connect by key, everything is fine | when able to connect by key, everything is fine | ||
| + | ==== create ~/.ssh/config for labka ==== | ||
| + | touch ~/.ssh/config | ||
| + | chmod 110 ~/.ssh/config | ||
| + | |||
| + | * add there this block of code; user needs to be correctly set up: | ||
| + | <code> | ||
| + | Host labka | ||
| + | user [SOME USER PICO] | ||
| + | hostname 193.84.207.21 | ||
| + | ForwardX11 yes | ||
| + | </code> | ||
| + | |||
| + | * next time, you can connect to server by | ||
| + | ssh labka | ||
| + | instead of | ||
| + | ssh [some_user]@193.84.207.21 | ||
| + | |||
| + | ==== add user to wheel group [grant him sudo] ==== | ||
| + | usermod -aG wheel username | ||
| ===== Change colour of shell ===== | ===== Change colour of shell ===== | ||