ssh, config the board and ssh-keygen

master
parent 0796e10b8e
commit ca3ee88274

@ -1,3 +1,122 @@
# basic-connection # Accessing to SBCs by USB
To connect into the SBC, attach the USB cable into the PC. Then, open the terminal and type:
```
$ ip addr
...
...
en10: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether f4:5e:ab:50:44:89
inet6 fe80::10a6:8287:252f:1a43/64 secured scopeid 0x16
inet 192.168.6.1/24 brd 192.168.6.255 en10
...
```
you will obtain a lot of `enX` or `awdlx` devices, try to search for the new detected devices and specially the one with the ip 192.168.6.1 or 192.168.7.1 that belongs to the BeagleBone devices, and XXX for the Raspberry Pi.
Then, use the `SSH` protocol, from now ssh, to access the board computer (please change the ip address by your ip device)
```
$ ssh debian@192.168.6.2
Debian GNU/Linux 10
BeagleBoard.org Debian Buster IoT Image 2022-07-01
Support: https://bbb.io/debian
default username:password is [debian:temppwd]
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Jul 7 07:08:40 2022 from 2806:2f0:5040:8572:7d51:e754:675:cd2a
```
# Accessing the RPi4 by ssh
The SBCs can be accessed by ssh protocol if it is enable (disable by default at raspberry). Thus, we only need to know the SBC's ip or hostname. By default the raspberry Pi 4 is `raspberry`, but username and password is defined by the user ([raspberry Pi imager](link)). Then, to make `ssh` use:
```
$ ssh username@hostname.local
```
or
```
$ ssh username@ip
```
## Error connections
When getting the error:
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for beaglebone.local has changed,
and the key for the corresponding IP address 2806:103e:5:50f4:3ad2:69ff:fef9:46b4
```
you have to edit the '.ssh/known_hosts' file, and delete the lien that contains the offending key and the corresponding IP address given the warning.
# Changing the bb's or rpi4's hostname
First edit the `/etc/hostname` file by:
```
$ sudo vim /etc/hostname
```
change the first and only line in this file to reflect your new hostname.
Then, edit the `/etc/hosts` file:
```
127.0.0.1 localhost
127.0.1.1 hostname.localdomain hostname
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
```
change the second line in both `hostname` (127.0.1.1) instances for your new hostanme (must be the same previously defined).
Finally, reboot your beagle or raspberry device and try to make ssh to the new hostname.
## Changing the user's password (Optional)
To change the default user's password use:
```
$ passwd
Changing password for debian.
Current password: temppwd
New password: xxxxxxx
...
```
# SSH Key pairs
To create key pairs use:
```
$ ssh-keygen -t ed25519 -C "your_email@example.com"
...
...
...
```
then copy the `*.pub` file generated:
```
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub debian@bbb-marx.local
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/gmarx/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Debian GNU/Linux 10
BeagleBoard.org Debian Buster IoT Image 2022-07-01
Support: https://bbb.io/debian
default username:password is [debian:temppwd]
debian@bbb-marx.local's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'debian@bbb-marx.local'"
and check to make sure that only the key(s) you wanted were added.
```
Basic connection and configuration of the single board computers using ssh.
Loading…
Cancel
Save