--Using Raspberry-Pi 4 --Work terminal is Windows
We are planning to build in this order, this time it will be the OS setting edition.
--OS installation / environment settings --Container environment construction --Application introduction
Raspberry Pi purchased the following. I just played around with it, so I could have used lower specs. I'm not sure, but if you buy a set, there's no problem! Purchased in the spirit of. https://www.amazon.co.jp/gp/product/B07ZRF5BC1/
It seems that the file system must be FAT32. At first I was thinking of pulling out the SD card of Nintendo Switch and using it, This is used this time because it was enclosed in the above set.
Download the exe file from the site https://www.raspberrypi.org/downloads/
Install and start with administrator privileges Specify the OS and write destination volume, and select [WRITE].
It took a while to complete. It may be a little over 30 minutes
Insert the SD card into the Raspberry Pi, turn on the power, copy the display with the HDMI cable and operate
--Ssh enabled
--VNC enabled
Confirm activation
# netstat -ant
Working internet connection(Server and establishment)
Proto reception-Q send-Q Internal address External address Status
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
Check the IP address with ifconfig here and switch to work with SSH connection
--vim installation
# apt install ^vim$
--IP address fixed
# vi /etc/dhcpcd.conf
==Postscript=====
interface wlan0
static ip_address=172.22.1.253/22
static routers=172.22.0.1
static domain_name_servers=172.22.255.1
# service sshd restart
--Distribution and firmware update
# apt-get dist-upgrade
# rpi-update
# apt-get update
# apt-get upgrade
Reboot once here and log in again
# shutdown -r now
--User creation, sudo settings
# adduser batch
# vi /etc/sudoers
==Postscript=====
batch ALL=(ALL) NOPASSWD: ALL
--Creating a private key / public key
# su - batch
$ ssh-keygen -t rsa -b 4096
$ scd .ssh/
$ schmod 600 id_rsa
$ smv id_rsa authorized_keys
$ ls -l
8 in total
-rw-------1 batch batch 3381 May 25 22:01 authorized_keys
-rw-------1 batch batch 743 May 25 22:01 id_rsa.pub
Download id_rsa.pub locally
--Modified sshd_config
Let's confirm the login while leaving the existing session.
# vi /etc/ssh/sshd_config
==Change the following====
PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
--Alias setting
I tried to write it in .bashrc, but when I looked at the contents .bash_aliase seemed to be more suitable, so I wrote it there
# vi .bash_aliase
==Described below====
alias ll='ls -la --color=auto'
--Swap disabled
Reboot is required to reflect the settings
# swapoff --all
# systemctl stop dphys-swapfile
# systemctl disable dphys-swapfile
# free -h
total used free shared buff/cache available
Mem: 3.7Gi 88Mi 3.1Gi 8.0Mi 611Mi 3.5Gi
Swap: 0B 0B 0B
--Disable unused log output
# vi /etc/rsyslog.conf
==Comment out the following====
#daemon.* -/var/log/daemon.log
#lpr.* -/var/log/lpr.log
#mail.* -/var/log/mail.log
#mail.info -/var/log/mail.info
#mail.warn -/var/log/mail.warn
#mail.err /var/log/mail.err
#*.=debug;\
# auth,authpriv.none;\
# news.none;mail.none -/var/log/debug
--Other
I wanted to set a partition as well, but I stopped because it was annoying. Make logrotate settings enter after application installation
Get a backup file in this state
Install Win32 Disk Imager https://sourceforge.net/projects/win32diskimager/
With Win32 Disk Imager running, connect the Raspberry Pi SD card to your work PC
File name of backup image in [ImageFIle] Specify the device name that the SD card is recognized in [Device]
Backup acquisition is completed in about 30 minutes.
Raspberry Pi-01 ~ Base environment construction ~ Set a fixed IP address for the wireless LAN of Raspberry Pi 3 (Raspbian Jessie) [[Raspberry Pi] How to back up the entire SD card](https://raspi.taneyats.com/entry/backup-sdcard#Win32-Disk-Imager%E3%82%A4%E3%83%B3%E3 % 82% B9% E3% 83% 88% E3% 83% BC% E3% 83% AB% E3% 81% 99% E3% 82% 8B)
Recommended Posts