VMSudo: fix git link and formatting

This commit is contained in:
Marek Marczykowski-Górecki 2015-05-22 22:19:00 +02:00
parent e5168b0da2
commit 21fd43f648

View File

@ -8,9 +8,8 @@ redirect_from: /wiki/VMSudo/
Password-less root access in VM Password-less root access in VM
=============================== ===============================
Background ([/etc/sudoers.d/qubes](http://git.qubes-os.org/?p=qubes-r2/core-agent-linux.git;a=blob;f=misc/qubes.sudoers;hb=HEAD) in VM): Background ([/etc/sudoers.d/qubes](https://github.com/QubesOS/qubes-core-agent-linux/blob/master/misc/qubes.sudoers) in VM):
{% highlight trac-wiki %}
user ALL=(ALL) NOPASSWD: ALL user ALL=(ALL) NOPASSWD: ALL
# WTF?! Have you lost your mind?! # WTF?! Have you lost your mind?!
@ -57,37 +56,30 @@ user ALL=(ALL) NOPASSWD: ALL
# be seen by the xinput program...) # be seen by the xinput program...)
# #
# joanna. # joanna.
{% endhighlight %}
Below is a complete list of configuration made according to the above statement, with (not necessary complete) list of mechanisms depending on each of them: Below is a complete list of configuration made according to the above statement, with (not necessary complete) list of mechanisms depending on each of them:
1. sudo (/etc/sudoers.d/qubes): 1. sudo (/etc/sudoers.d/qubes):
{% highlight trac-wiki %}
user ALL=(ALL) NOPASSWD: ALL user ALL=(ALL) NOPASSWD: ALL
(...) (...)
{% endhighlight %}
- easy user-\>root access (main option for the user) - easy user->root access (main option for the user)
- qvm-usb (not really working, as of R2) - qvm-usb (not really working, as of R2)
2. PolicyKit (/etc/polkit-1/rules.d/00-qubes-allow-all.rules): 2. PolicyKit (/etc/polkit-1/rules.d/00-qubes-allow-all.rules):
{% highlight trac-wiki %}
//allow any action, detailed reasoning in sudoers.d/qubes //allow any action, detailed reasoning in sudoers.d/qubes
polkit.addRule(function(action,subject) { return polkit.Result.YES; }); polkit.addRule(function(action,subject) { return polkit.Result.YES; });
{% endhighlight %}
and /etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla: and /etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla:
{% highlight trac-wiki %}
[Qubes allow all] [Qubes allow all]
Identity=* Identity=*
Action=* Action=*
ResultAny=yes ResultAny=yes
ResultInactive=yes ResultInactive=yes
ResultActive=yes ResultActive=yes
{% endhighlight %}
- NetworkManager configuration from normal user (nm-applet) - NetworkManager configuration from normal user (nm-applet)
- updates installation (gpk-update-viewer) - updates installation (gpk-update-viewer)
@ -104,34 +96,26 @@ While ITL still supports the statement above, some Qubes users may want to enabl
1. Adding Dom0 "VMAuth" service: 1. Adding Dom0 "VMAuth" service:
{% highlight trac-wiki %}
[root@dom0 /]# echo -n "/usr/bin/echo 1" >/etc/qubes-rpc/qubes.VMAuth [root@dom0 /]# echo -n "/usr/bin/echo 1" >/etc/qubes-rpc/qubes.VMAuth
[root@dom0 /]# echo -n "$anyvm dom0 ask" >/etc/qubes-rpc/policy/qubes.VMAuth [root@dom0 /]# echo -n "$anyvm dom0 ask" >/etc/qubes-rpc/policy/qubes.VMAuth
{% endhighlight %}
(Note: any VMs you would like still to have password-less root access (e.g. TemplateVMs) can be specified in the second file with "\<vmname\> dom0 allow") (Note: any VMs you would like still to have password-less root access (e.g. TemplateVMs) can be specified in the second file with "\<vmname\> dom0 allow")
2. Configuring TemplateVM to prompt Dom0 for any authorization request: 2. Configuring TemplateVM to prompt Dom0 for any authorization request:
- In /etc/pam.d/system-auth, replace all lines beginning with "auth" with one line: - In /etc/pam.d/system-auth, replace all lines beginning with "auth" with one line:
{% highlight trac-wiki %}
auth [success=done default=die] pam_exec.so seteuid /usr/lib/qubes/qrexec-client-vm dom0 qubes.VMAuth /usr/bin/grep -q ^1$ auth [success=done default=die] pam_exec.so seteuid /usr/lib/qubes/qrexec-client-vm dom0 qubes.VMAuth /usr/bin/grep -q ^1$
{% endhighlight %}
- Require authentication for sudo. Replace the first line of /etc/sudoers.d/qubes with: - Require authentication for sudo. Replace the first line of /etc/sudoers.d/qubes with:
{% highlight trac-wiki %}
user ALL=(ALL) ALL user ALL=(ALL) ALL
{% endhighlight %}
- Disable PolKit's default-allow behavior: - Disable PolKit's default-allow behavior:
{% highlight trac-wiki %}
[root@fedora-20-x64]# rm /etc/polkit-1/rules.d/00-qubes-allow-all.rules [root@fedora-20-x64]# rm /etc/polkit-1/rules.d/00-qubes-allow-all.rules
[root@fedora-20-x64]# rm /etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla [root@fedora-20-x64]# rm /etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
{% endhighlight %}
Dom0 password-less root access Dom0 password-less root access
------------------------------ ------------------------------
There is also password-less user-\>root access in dom0. As stated in comment in sudo configuration there (different one than VMs one), there is really no point in user/root isolation, because all the user data (and VM management interface) is already accessible from dom0 user level, so there is nothing more to get from dom0 root account. There is also password-less user->root access in dom0. As stated in comment in sudo configuration there (different one than VMs one), there is really no point in user/root isolation, because all the user data (and VM management interface) is already accessible from dom0 user level, so there is nothing more to get from dom0 root account.