Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. ## Configuration
  2. First things first. Fix the keyboard and other configuration.
  3. ```
  4. sudo raspi-config
  5. ```
  6. #### keyboard
  7. ```
  8. ->Localisation Options
  9. ->Change Keyboard Layout
  10. ->Generic 105-key (Intl) PC
  11. ->Other
  12. ->English (US)
  13. ->English (US)
  14. ```
  15. Then choose the rest of the options as you desire.
  16.  
  17. #### hostname
  18. ```
  19. ->Hostname
  20. ```
  21. Then type in your desired `hostame`
  22.  
  23. #### Peripherals
  24. ```
  25. ->Interfacing Options
  26. ->SSH
  27. ->Yes
  28. ->Interfacing Options
  29. ->SPI
  30. ->Yes
  31. ->Interfacing Options
  32. ->I2C
  33. ->Yes
  34. ```
  35.  
  36. ## Change the Default User
  37.  
  38. #### Change the username
  39.  
  40. In order to change the username 'pi' we will have to log in a the root user since it's not possible to rename an account while your logged into it. To log in as root user first we have to enable it, to do so type the following command whilst logged in as the default pi user:
  41.  
  42. ```
  43. sudo passwd root
  44. ```
  45.  
  46. Choose a secure password for the root user. You can disable the root account later if you wish.
  47.  
  48. Now logout of the user pi using the command:
  49.  
  50. ```
  51. logout
  52. ```
  53.  
  54. And then logout back in as the user 'root' using the password you just created. Now we can rename the the default pi user name. The following method renames the user 'pi' to 'newname', replace this with whatever you want. Type the command:
  55.  
  56. ```
  57. usermod -l newname pi
  58. ```
  59.  
  60. Now the user name has been changed the user's home directory name should also be changed to reflect the new login name:
  61.  
  62. ```
  63. usermod -m -d /home/newname newname
  64. ```
  65.  
  66. Now logout and login back in as newname. You can change the default password from raspberry to something more secure by typing following command and entering a new password when prompted:
  67.  
  68. ```
  69. passwd
  70. ```
  71.  
  72. If you wish you can disable the root user account again but first double check newname still has 'sudo' privileges. Check the following update command works:
  73.  
  74. ```
  75. sudo apt-get update
  76. ```
  77.  
  78. If it works then you can disable the root account by locking the password:
  79.  
  80. ```
  81. sudo passwd -l root
  82. ```
  83. #### Re-enable auto-login
  84.  
  85. Manually modify the raspi-config script as follows. Let's presume we're using the username "bob".
  86. ```
  87. sudo nano /usr/bin/raspi-config
  88. ```
  89. then search for
  90. ```
  91. do_boot_behaviour() {...}
  92. ```
  93. Under that, there's a line where we will replace the `-u pi` with `-u bob`, leaving the rest of the line unchanged:
  94. ```
  95. if id -u pi > /dev/null 2>&1; then
  96. ```
  97. Next edit the line:
  98. ```
  99. sed /etc/lightdm/lightdm.conf -i -e "s/^#autologin-user=.*/autologin-user=pi/"
  100. ```
  101. By changing `autologin-user=pi` to be `autologin-user=bob`
  102.  
  103. If you want a pretty menu and also error when it occurs, edit these lines:
  104. ```
  105. whiptail --msgbox "The pi user has been removed, can't set up boot to desktop" 20 60 2
  106. "Desktop" "Log in as user 'pi' at the graphical desktop" \
  107. ```
  108. Again, replacing `pi` with `bob`, or your username of choice.
  109.  
  110. Now the only thing left is enter raspi-config:
  111. ```
  112. sudo raspi-config
  113. ```
  114. Select the third option:
  115. ```
  116. 3 Enable Boot to Desktop/Scratch
  117. ```
  118. And then select the second:
  119. ```
  120. Desktop Log in as user 'bob' at the graphical desktop
  121. ```
  122. This way the configuration files are written (crucial) and you are ready to automatically boot into the GUI
  123.  
  124. ## Useful tools
  125.  
  126. Install some of the basics:
  127. ```
  128. sudo apt update
  129. sudo apt install network-manager vim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement