Advertisement
Guest User

Script to install a stretch-minimal Template in qubes-oslate

a guest
Jul 11th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.04 KB | None | 0 0
  1. #Installing Ubuntu-14-04-02-minimal as template qube in qubes-os 4.0:
  2.  
  3.  
  4. #First get unman's package from 3isec.org (replace <downloadAppVM> with the AppVM used for downloading):
  5.  
  6. #[user@<downloadAppVM>]$ wget -c http://qubes.3isec.org/Templates_4.0/qubes-template-stretch-minimal-4.0.1-201812230252.noarch.rpm
  7.  
  8.  
  9. #Copy package to dom0:
  10.  
  11. #[user@dom0]$
  12. sudo qvm-run --pass-io <downloadAppVM> 'cat /home/user/Downloads/qubes-template-stretch-minimal-4.0.1-2012230252.noarch.rpm' > /home/user/Downloads/qubes-template-stretch-minimal-4.0.1-2012230252.noarch.rpm
  13.  
  14.  
  15. #Install package into template VM 'stretch-minimal':
  16.  
  17. #[user@dom0 ~]$
  18. sudo dnf install /home/user/Downloads/qubes-template-stretch-minimal-4.0.1-2012230252.noarch.rpm
  19.  
  20.  
  21. #Start the template VM 'stretch-minimal':
  22.  
  23. #Desktop-right-click | Applications | Template: stretch-minimal | stretch-minimal: XTerm
  24.  
  25.  
  26. #Set password for user:
  27.  
  28. #[user@dom0 ~]$
  29. qvm-run -p --user root stretch-minimal "echo -e 'newuserpwd\nnewuserpwd' | passwd user"
  30.  
  31.  
  32. #Add user 'user' to sudo group:
  33.  
  34. #Normally this would be done using
  35.  
  36. #[user@dom0 ~]$ qvm-run -p --user root stretch-minimal "usermod -a -G sudo user"
  37.  
  38. #but that didn't work for some reason, even after issuing
  39.  
  40. #[user@dom0 ~]$ qvm-run -p --user root stretch-minimal "service sudo restart"
  41.  
  42. #and even after confirming that 'user' is added to group 'sudo' in 'stretch-minimal' by giving the command in stretch-minimal's XTerm:
  43.  
  44. #user@stretch-minimal:~$ cat /etc/group | grep sudo
  45.  
  46. #and seeing the existence of the line "sudo:x:27:user"
  47.  
  48.  
  49. #What does work is adding the user 'user' directly to the /etc/sudoers file by
  50.  
  51. #[user@dom0 ~]$
  52. qvm-run -p --user printf 'user ALL(ALL:ALL) ALL\n\n' >> /etc/sudoers"
  53.  
  54. #and then restarting stretch-minimal's sudo server:
  55.  
  56. #[user@dom0 ~]$
  57. qvm-run -p --user stretch-minimal "service sudo restart"
  58.  
  59.  
  60. #Now we can check in stretch-minimal itself:
  61.  
  62. #user@stretch-minimal:~$ sudo cat /etc/sudoers
  63.  
  64. #and use the sudo command.
  65.  
  66.  
  67. #[user@dom0 ~]$
  68. qvm-run -p --user stretch-minimal "cat /etc/sudoers"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement