operating_systems:raspbian:minimal_configuration
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| operating_systems:raspbian:minimal_configuration [2019/06/12 06:36] – [Rename hostname] maferreira | operating_systems:raspbian:minimal_configuration [2019/07/22 09:48] (current) – removed maferreira | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Minimal configuration ====== | ||
| - | ===== Enable root account ===== | ||
| - | As root account is disabled by default on raspbian, we need to activate it. But before doing that, mount / in read-write mode. | ||
| - | # mount -o remount,rw / | ||
| - | # passwd root | ||
| - | And then enter the new password you want. | ||
| - | $ su root | ||
| - | ===== Rename user ===== | ||
| - | # usermod -l acdsn pi | ||
| - | # usermod -m -d /home/acdsn acdsn | ||
| - | Set a password to the user | ||
| - | # passwd acdsn | ||
| - | |||
| - | ===== Rename group ===== | ||
| - | # groupmod --new-name acdsn pi | ||
| - | |||
| - | ===== Rename hostname ===== | ||
| - | # vi / | ||
| - | Replace the existing hostname by the new one. | ||
| - | ===== SSH connection ===== | ||
| - | ====Generate ssh keys==== | ||
| - | $ ssh-keygen -t rsa -b 2048 | ||
| - | |||
| - | Add your public key to the server eG file (/ | ||
| - | |||
| - | ====sshd_config file==== | ||
| - | # vi / | ||
| - | | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | ====Allow connection from the server==== | ||
| - | Create the **/ | ||
| - | |||
| - | =====Turn off usb ports power===== | ||
| - | **uhubctl** is utility to control USB power per-port on smart USB hubs. Smart hub is defined as one that implements per-port power switching.\\ | ||
| - | In order to install it, follow the following steps: | ||
| - | $ git clone git:// | ||
| - | Install uhubctl dependency: | ||
| - | # apt install libusb-1.0-0-dev | ||
| - | |||
| - | Compile the source code: | ||
| - | $ make | ||
| - | |||
| - | Once the program is compiled, turn off usb ports power. But first, let's check usb ports ids. | ||
| - | # ./uhubctl | ||
| - | | ||
| - | Port 1: 0503 power highspeed enable connect [0424:ec00] | ||
| - | Port 2: 0100 power | ||
| - | Port 3: 0100 power | ||
| - | Port 4: 0103 power | ||
| - | Port 5: 0100 power | ||
| - | Now, you have identified the usb ports ids. Turn off their power. | ||
| - | # ./uhubctl -a on -p 2 | ||
| - | <note warning> | ||
| - | Add the last command to your crontab table. | ||
| - | @reboot / | ||
| - | |||
| - | ====References==== | ||
| - | https:// | ||
| - | https:// | ||
| - | |||
| - | ===== Change timezone ===== | ||
| - | For me, the default timezone was London. To change it, type: | ||
| - | <code bash> | ||
| - | # dpkg-reconfigure tzdata | ||
| - | </ | ||
| - | |||
| - | ===== Crontabs ===== | ||
| - | Since /var/spool in mounted on tmps, crontab files don't exist and so, crontab will fail. To solve this, move/add crontab files for the user you want. | ||
| - | # vi / | ||
| - | |||
| - | 0/5 * * * * < | ||
| - | |||
| - | Make sure you have the following file rights: | ||
| - | <code bash> | ||
| - | drwxr-xr-x | ||
| - | drwxr-xr-x 89 root root 4096 May 6 11:05 .. | ||
| - | -rw-r--r-- | ||
| - | -rw------- | ||
| - | </ | ||
| - | <note warning> | ||
| - | |||
| - | ===== Disable bash history ===== | ||
| - | <note warning> | ||
| - | |||
| - | ==== acdsn ==== | ||
| - | # vi / | ||
| - | <code bash> | ||
| - | #! /bin/bash | ||
| - | |||
| - | history -c | ||
| - | set +o history | ||
| - | |||
| - | export HISTFILESIZE=0 | ||
| - | export HISTSIZE=0 | ||
| - | unset HISTFILE | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | # chmod a+x / | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | # ln -s / | ||
| - | </ | ||
| - | ==== root ==== | ||
| - | <code bash> | ||
| - | # mv / | ||
| - | # mv / | ||
| - | # ln -s / | ||
| - | </ | ||
| - | |||
| - | Import **noHistory.sh** into .bashrc | ||
| - | |||
| - | <code bash> | ||
| - | if [ -r / | ||
| - | . / | ||
| - | fi | ||
| - | </ | ||
| - | |||
| - | Reference: http:// | ||
operating_systems/raspbian/minimal_configuration.1560321365.txt.gz · Last modified: 2019/06/12 06:36 by maferreira