# New user: calf:admin groupadd admin useradd -g admin calf chsh -s /bin/bash calf mkhomedir_helper calf chmod +w /etc/sudoers vim /etc/sudoers # add a line: # calf ALL=(ALL) NOPASSWD: ALL chmod -w /etc/sudoers
# Setup ssh-key su - calf pwd # /home/calf ssh-keygen -t ed25519 vim .ssh/authorized_keys # add local machine's pub key into this file, then save chmod 644 .ssh/authorized_keys
# Disable password login, disable root login sudo vim /etc/ssh/sshd_config # make sure these settings: # PasswordAuthentication no # PermitRootLogin no # KbdInteractiveAuthentication no sudo sshd -t sudo service ssh reload
Azure Specific
By default, the root user is not allowed to log in via SSH.
In case if really needed, modify .ssh/authorized_keys, comment out the following line then add public key:
1
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"calf\" rather than the user \"root\".';echo;sleep 10;exit 142" ssh-ed25519 ......
# To install the latest version of docker. sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker --version #> Docker version 28.3.0, build 38b7060 docker compose version #> Docker Compose version v2.37.3
service docker status
To allow non-privileged users to run Docker commands:
1 2 3 4 5 6
sudo usermod -aG docker USER
# Log out and log back in so that your group membership is re-evaluated. # Try `docker ps` without `sudo`. docker ps #> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# df -h Filesystem Size Used Avail Use% Mounted on /dev/mmcblk1p2 6.9G 1.3G 5.5G 20% /
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS mmcblk1 179:0 0 58.2G 0 disk ├─mmcblk1p1 179:1 0 256M 0 part /boot └─mmcblk1p2 179:2 0 7.1G 0 part /var/log.hdd /
# ./expand_emmc_rootfs.sh are you sure resize /dev/mmcblk1p2? (y/n) y Warning: Not all of the space available to /dev/mmcblk1 appears to be used, you can fix the GPT to use all of the space (an extra 106414080 blocks) or continue with the current setting? Fix/Ignore? f Partition number? 2 Warning: Partition /dev/mmcblk1p2 is being used. Are you sure you want to continue? Yes/No? y End? [7885MB]? 100% Information: You may need to update /etc/fstab.
start resize emmc... resize2fs 1.46.5 (30-Dec-2021) Filesystem at /dev/mmcblk1p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 8 The filesystem on /dev/mmcblk1p2 is now 15198203 (4k) blocks long.
resize finished
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS mmcblk1 179:0 0 58.2G 0 disk ├─mmcblk1p1 179:1 0 256M 0 part /boot └─mmcblk1p2 179:2 0 58G 0 part /var/log.hdd /
# df -h Filesystem Size Used Avail Use% Mounted on /dev/mmcblk1p2 58G 1.3G 56G 3% /
Install Docker
1 2 3 4 5 6 7 8 9 10 11 12 13
apt update apt install -y apparmor-utils docker.io docker-compose # Note: there is no docker-compose-plugin
docker --version #> Docker version 28.2.2, build 28.2.2-0ubuntu1~22.04.1 docker-compose version #> docker-compose version 1.29.2, build unknown #> docker-py version: 5.0.3 #> CPython version: 3.10.12 #> OpenSSL version: OpenSSL 3.0.2 15 Mar 2022