Basic connection and configuration of the single board computers using ssh.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.8 KiB

2 years ago
  1. # Accessing to SBCs by USB
  2. To connect into the SBC, attach the USB cable into the PC. Then, open the terminal and type:
  3. ```
  4. $ ip addr
  5. ...
  6. ...
  7. en10: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  8. ether f4:5e:ab:50:44:89
  9. inet6 fe80::10a6:8287:252f:1a43/64 secured scopeid 0x16
  10. inet 192.168.6.1/24 brd 192.168.6.255 en10
  11. ...
  12. ```
  13. 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.
  14. Then, use the `SSH` protocol, from now ssh, to access the board computer (please change the ip address by your ip device)
  15. ```
  16. $ ssh debian@192.168.6.2
  17. Debian GNU/Linux 10
  18. BeagleBoard.org Debian Buster IoT Image 2022-07-01
  19. Support: https://bbb.io/debian
  20. default username:password is [debian:temppwd]
  21. The programs included with the Debian GNU/Linux system are free software;
  22. the exact distribution terms for each program are described in the
  23. individual files in /usr/share/doc/*/copyright.
  24. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
  25. permitted by applicable law.
  26. Last login: Thu Jul 7 07:08:40 2022 from 2806:2f0:5040:8572:7d51:e754:675:cd2a
  27. ```
  28. # Accessing the RPi4 by ssh
  29. 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:
  30. ```
  31. $ ssh username@hostname.local
  32. ```
  33. or
  34. ```
  35. $ ssh username@ip
  36. ```
  37. ## Error connections
  38. When getting the error:
  39. ```
  40. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  41. @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
  42. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  43. The ECDSA host key for beaglebone.local has changed,
  44. and the key for the corresponding IP address 2806:103e:5:50f4:3ad2:69ff:fef9:46b4
  45. ```
  46. 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.
  47. # Changing the bb's or rpi4's hostname
  48. First edit the `/etc/hostname` file by:
  49. ```
  50. $ sudo vim /etc/hostname
  51. ```
  52. change the first and only line in this file to reflect your new hostname.
  53. Then, edit the `/etc/hosts` file:
  54. ```
  55. 127.0.0.1 localhost
  56. 127.0.1.1 hostname.localdomain hostname
  57. # The following lines are desirable for IPv6 capable hosts
  58. ::1 localhost ip6-localhost ip6-loopback
  59. ff02::1 ip6-allnodes
  60. ff02::2 ip6-allrouters
  61. ```
  62. change the second line in both `hostname` (127.0.1.1) instances for your new hostanme (must be the same previously defined).
  63. Finally, reboot your beagle or raspberry device and try to make ssh to the new hostname.
  64. ## Changing the user's password (Optional)
  65. To change the default user's password use:
  66. ```
  67. $ passwd
  68. Changing password for debian.
  69. Current password: temppwd
  70. New password: xxxxxxx
  71. ...
  72. ```
  73. # SSH Key pairs
  74. To create key pairs use:
  75. ```
  76. $ ssh-keygen -t ed25519 -C "your_email@example.com"
  77. ...
  78. ...
  79. ...
  80. ```
  81. then copy the `*.pub` file generated:
  82. ```
  83. $ ssh-copy-id -i ~/.ssh/id_ed25519.pub debian@bbb-marx.local
  84. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/gmarx/.ssh/id_ed25519.pub"
  85. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  86. /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
  87. Debian GNU/Linux 10
  88. BeagleBoard.org Debian Buster IoT Image 2022-07-01
  89. Support: https://bbb.io/debian
  90. default username:password is [debian:temppwd]
  91. debian@bbb-marx.local's password:
  92. Number of key(s) added: 1
  93. Now try logging into the machine, with: "ssh 'debian@bbb-marx.local'"
  94. and check to make sure that only the key(s) you wanted were added.
  95. ```