Next, the whole process of Linux system installation-1 , continue to describe the subsequent installation steps.
4: Create user
4.1 Create user + user directory
Use the following command to create a user and user directory
sudo mkdir /home/clou-tcu/kongcb
sudo useradd kongcb –d /home/clou-tcu/kongcb –s /bin/bash
sudo passwd kongcb //Enter password
chown kongcb:kongcb /home/clou-tcu/kongcb //Change directory
sudo usermod –aG sudo kongcb //Join sudo group
4.2 Configure samba commands
sudo smbpasswd –a kongcb //Enter the password as prompted
sudo service smbd restart
Then you can map the network disk.
4.3 Delete user command
Delete user command:
Sudo userdel –r kongcb //At the same time as deleting the user, delete the user's home directory. If not deleted, the home directory will have no owner and group, and it will be a junk file.
For this operation, the actual operation process of the kernel is as follows:
1. Modify the user information file /etc/passwd:
kongcb:x:1001:1001::/home/clou-tcu/kongcb:/bin/bash <--Delete this line
2. Modify the shadow file /etc/shadow and delete the lamp user password
kongcb:$6$KoOYtcOJ$56Xk9vp3D2vMRBxibNOn.21cVJ9onbW8IHx4WrOx6qBqfGa9U3mjMsGjqYnj L/4t3zt3YxElce2X8rbb12x4a0:15716:0:99999:7::: <--delete this line
3. Delete lamp group information, /etc/group
kongcb:x:501: <--Delete this line
4. Delete lamp group password information, /etc/gshadow
kongcb:!:: <--Delete this line
5. Delete user mailbox:
rm -rf /var/spod/mail/kongcb
6. Delete the user’s home directory:
rm -rf/home/clou-tcu/kongcb
5: Update the kernel
Check the kernel. The kernel version is:
4.15.0-20-generic
Copy the downloaded linux-headers-5.4.80-050480_5.4.80-050480.202011240944_all.deb to the mapped disk
Install:
Sudo dpkg –i linux-headers-5.4.80-050480_5.4.80-050480.202011240944_all.deb
After the installation is complete, update grub and restart
Sudo update-grub
Sudo reboot
After startup, the kernel is still 4.15. It should have failed. Check what kernel is installed:
Sudo dpkg –get-selections |grep linux
Check that the 5.4.80 kernel is installed
But there is only one linux-headers-5.4.80-050480,
There should be only one header. You also need to add other files of the kernel. Follow 1.3 to download.
Change to version 70 supported by the system
Download the three files above and install them together.
sudo dpkg --install *.deb
installation tips:
dpkg: error: dpkg status database is locked by another process
Follow online tips:
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure –a
Then install: sudo dpkg --install *.deb
Can be executed
Check after restarting: uname –a
The kernel is already: 5.4.70-050470-generic
6: Install encryption system
Copy the encryption software to ubuntu and install it. It fails. Changing the kernel to 5.4.70-050470-generic is not supported.
It seems that the kernel version must be completely consistent.
The background still uses the old Ubuntu version according to the document requirements:
64-bit Ubuntu 16.04.7 LTS kernel 4.15.0-generic minor versions 112, 128, 139, 140, 142
After the installation is completed, the kernel is exactly 4.15.0-112
Do not follow the system prompts to upgrade Ubuntu to version 18.
As above, installing the specified kernel is just to install the encryption software. In fact, Ubuntu currently has limited support for updating non-lts version kernels. Even if the relevant kernels are installed as above, subsequent installation of encryption software may fail (even a slight difference in the kernel subversion will result in failure to install). The best version is to choose an old version 16 according to the requirements of the encryption software, so that both Ubuntu and the Linux kernel can support it very well, and it can be done in one step.