Ubuntu/Raspberry Pi

From Chorke Wiki
Revision as of 10:12, 14 November 2021 by Shahed (talk | contribs)
Jump to navigation Jump to search

Network Config:

ls -lah /Volumes/system-boot/|grep network-config
cat <<EOF > /Volumes/system-boot/network-config
version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "ChorkeOrg_2.4GHz":
        password: "sadaqah!"
      "ChorkeOrg":
        password: "sadaqah!"
EOF

User Data:

ls -lah /Volumes/system-boot/|grep user-data
cat <<EOF > /Volumes/system-boot/user-data
#cloud-config
system_info:
  default_user:
    name: pi
chpasswd:
  expire: true
  list:
  - pi:ubuntu
ssh_pwauth: true
runcmd:
- [ df, -h, / ]
- [ sh, -xc, "echo $(date) ': hello academian!'" ]
power_state:
  mode: reboot
EOF

ls -lah /Volumes/system-boot/{.fseventsd,.Spotlight-V100}
rm -rf /Volumes/system-boot/{.fseventsd,.Spotlight-V100}

ssh [email protected]
:<<EOF
The authenticity of host '10.19.83.111 (10.19.83.111)' can't be established.
ECDSA key fingerprint is SHA256:9Lgs5Xxsypm4s/3F87TU2EMh6vUz6pjAMaNHXUDImVs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.19.83.111' (ECDSA) to the list of known hosts.
[email protected]'s password: 
You are required to change your password immediately (administrator enforced)
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1042-raspi aarch64)

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for pi.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully
Connection to 10.19.83.111 closed.
EOF

ssh [email protected]
:<<EOF
[email protected]'s password: 
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1042-raspi aarch64)
EOF

References