Snippets Collections
# In Crosh
# Ctrl + Alt + t
vmc start termina
 lxc launch ubuntu:18.04 owo
  lxc file pull owo/usr/bin/lxc /tmp/lxc
  lxc file push /tmp/lxc penguin/usr/local/bin/
  lxc delete owo -f
  lxc config set core.https_address :8443
  lxc config set core.trust_password "a'really,good;password:^)"

# in container terminal
  lxc remote add chronos $(ip route show | awk '{print $3}' | head -n 1)
  lxc remote set-default chronos

# have fun
lxc exec container_name -- bash
# Deal with sudo authentication errors on back up
# two write permissions errors on backup restore:
# 1. check chown and chmod of sudo 
# 2. sudo: /usr/bin/sudo must be owned by uid 0 
# 3. and have the setuid bit set

# 1. sudo ownership
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo

# 2. UID ownership
grep root /etc/passwd
# the default root should be set to:
# root:x:0:0:root:/root:/bin/bash
# if not sudoedit as above.

# 3. setuid bit
# check /usr/bin for setuid bit errors (vs. clean normal installation of distro)
# (for debian 11) incorrect configuration includes su and sudo and 8 other executables
# Incorrect format is (compare first 4 permsissions) 
# -rwxr-xr-x 1 root root 179K Feb 27 2021 sudo
# correct format is 
# -rwsr-xr-x 1 root root 182600 Feb 27  2021 /usr/bin/sudo
# prefer pkexec to nake changes 
pkexec chmod a=rx,u+ws /usr/bin/sudo
pkexec chmod a=rx,u+ws /usr/bin/su
# compare vs. a unmodified fresh virtual install of your system
# in Debian 11 8 further files need modifying

# bonus. on your way out check permissing in  /usr/lib/sudo/ and compare with base install.
star

Mon Oct 03 2022 15:50:07 GMT+0000 (UTC) https://github.com/edeloya/ChromeOS-Terminal-LXC-LXD

#permissions #shell #backup #chromeos

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension