User Tools

Site Tools


operating_systems:raspbian:minimal_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
operating_systems:raspbian:minimal_configuration [2019/05/27 09:33] – [root] maferreiraoperating_systems:raspbian:minimal_configuration [2019/07/08 15:14] – [sshd_config file] maferreira
Line 2: Line 2:
 ===== Enable root account ===== ===== 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. 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 / +  # mount -o remount,rw / 
-    # passwd root+  # passwd root
 And then enter the new password you want. And then enter the new password you want.
-    $ su root+  $ su root
  
 ===== Rename user =====     ===== Rename user =====    
-    # usermod -l acdsn pi +  # usermod -l acdsn pi 
-    # usermod -m -d /home/acdsn acdsn+  # usermod -m -d /home/acdsn acdsn
 Set a password to the user Set a password to the user
-    # passwd acdsn+  # passwd acdsn
  
 ===== Rename group ===== ===== Rename group =====
-    # groupmod --new-name acdsn pi+  # groupmod --new-name acdsn pi
  
 ===== Rename hostname ===== ===== Rename hostname =====
-    # vi /etc/hostname+  # vi /etc/hostname
 Replace the existing hostname by the new one. Replace the existing hostname by the new one.
 ===== SSH connection ===== ===== SSH connection =====
 ====Generate ssh keys==== ====Generate ssh keys====
-    $ ssh-keygen -t rsa -b 2048+  $ ssh-keygen -t rsa -b 2048
  
 Add your public key to the server eG file (/home/acdsn/.ssh/eG). Add your public key to the server eG file (/home/acdsn/.ssh/eG).
  
 ====sshd_config file==== ====sshd_config file====
-    # vi /etc/ssh/sshd_config +  # vi /etc/ssh/sshd_config 
-     + 
-    #ListenAddress 0.0.0.0 -ListenAddress 127.0.0.1 +From 
-    #PermitRootLogin prohibit-password -> PermitRootLogin no + 
-    #PubkeyAuthentication yes -> PubkeyAuthentication yes +  #ListenAddress 0.0.0.0 
-    #PasswordAuthentication yes -> PasswordAuthentication no+  #PermitRootLogin prohibit-password 
 +  #PubkeyAuthentication yes 
 +  #PasswordAuthentication yes 
 + 
 +To 
 + 
 +  ListenAddress 127.0.0.1 
 +  PermitRootLogin no 
 +  PubkeyAuthentication yes 
 +  PasswordAuthentication no
 ====Allow connection from the server==== ====Allow connection from the server====
 Create the **/home/acdsn/.ssh/authorized_keys** file and add the **server public key**. Create the **/home/acdsn/.ssh/authorized_keys** file and add the **server public key**.
Line 38: Line 47:
 **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.\\ **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: In order to install it, follow the following steps:
-    $ git clone git://github.com/mvp/uhubctl.git+  $ git clone git://github.com/mvp/uhubctl.git
 Install uhubctl dependency: Install uhubctl dependency:
-    # apt install libusb-1.0-0-dev+  # apt install libusb-1.0-0-dev
  
 Compile the source code: Compile the source code:
-    $ make+  $ make
  
 Once the program is compiled, turn off usb ports power. But first, let's check usb ports ids. Once the program is compiled, turn off usb ports power. But first, let's check usb ports ids.
-     # ./uhubctl +   # ./uhubctl 
-     Current status for hub 1-1 [0424:9514, USB 2.00, 5 ports] +   Current status for hub 1-1 [0424:9514, USB 2.00, 5 ports] 
-       Port 1: 0503 power highspeed enable connect [0424:ec00] +     Port 1: 0503 power highspeed enable connect [0424:ec00] 
-       Port 2: 0100 power +     Port 2: 0100 power 
-       Port 3: 0100 power +     Port 3: 0100 power 
-       Port 4: 0103 power +     Port 4: 0103 power 
-       Port 5: 0100 power+     Port 5: 0100 power
 Now, you have identified the usb ports ids. Turn off their power. Now, you have identified the usb ports ids. Turn off their power.
-     # ./uhubctl -a on -p 2+   # ./uhubctl -a on -p 2
 <note warning>After some tests, I figured out that the port 2 is the only that enables/disables all usb port</note> <note warning>After some tests, I figured out that the port 2 is the only that enables/disables all usb port</note>
 Add the last command to your crontab table. Add the last command to your crontab table.
-    @reboot /home/acdsn/git/uhubctl/uhubctl -a off -p 2+  @reboot /home/acdsn/git/uhubctl/uhubctl -a off -p 2
  
 ====References==== ====References====
Line 65: Line 74:
 ===== Change timezone ===== ===== Change timezone =====
 For me, the default timezone was London. To change it, type: For me, the default timezone was London. To change it, type:
-    # dpkg-reconfigure tzdata+<code bash> 
 +# dpkg-reconfigure tzdata 
 +</code>
  
 ===== Crontabs ===== ===== 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. 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 /etc/cron.d/<username>+  # vi /etc/cron.d/<username>
  
-    0/5 * * * * <username> <command>+  0/5 * * * * <username> <command>
  
 Make sure you have the following file rights: Make sure you have the following file rights:
-    drwxr-xr-x  2 root root 4096 May  6 11:13 . +<code bash> 
-    drwxr-xr-x 89 root root 4096 May  6 11:05 .. +  drwxr-xr-x  2 root root 4096 May  6 11:13 
-    -rw-r--r--  1 root root  102 Oct  7  2017 .placeholder +  drwxr-xr-x 89 root root 4096 May  6 11:05 .. 
-    -rw-------  1 root root 1862 May  6 10:41 <username>+  -rw-r--r--  1 root root  102 Oct  7  2017 .placeholder 
 +  -rw-------  1 root root 1862 May  6 10:41 <username
 +</code>
 <note warning>The root user **MUST** be the owner of /etc/cron.d/<username></note> <note warning>The root user **MUST** be the owner of /etc/cron.d/<username></note>
  
Line 84: Line 97:
  
 ==== acdsn ==== ==== acdsn ====
-    # vi /home/acdsn/git/fw-rules/<port number>/etc/profile.d/noHistory.sh+  # vi /home/acdsn/git/fw-rules/<port number>/etc/profile.d/noHistory.sh
 <code bash> <code bash>
 #! /bin/bash #! /bin/bash
Line 105: Line 118:
 ==== root ==== ==== root ====
 <code bash> <code bash>
-    # mv /etc/bash.bashrc /home/acdsn/git/fw-rules/<port number>/etc/ +# mv /etc/bash.bashrc /home/acdsn/git/fw-rules/<port number>/etc/ 
-    # mv /home/acdsn/git/fw-rules/<port number>/etc/.bashrc /home/acdsn/git/fw-rules/<port number>/etc/bashrc.root +# mv /home/acdsn/git/fw-rules/<port number>/etc/.bashrc /home/acdsn/git/fw-rules/<port number>/etc/bashrc.root 
-    # ln -s /home/acdsn/git/fw-rules/3780/bashrc.root .bashrc+# ln -s /home/acdsn/git/fw-rules/3780/bashrc.root .bashrc
 </code> </code>