Changeset 3da508c


Ignore:
Timestamp:
12/15/2013 06:16:12 PM (10 years ago)
Author:
Fernando de Oliveira <fernando@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
31ff9f72
Parents:
bef99d8
Message:

Gparted from a menu: 'ssh-askpass' and 'pkexec'.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@12399 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • introduction/welcome/changelog.xml

    rbef99d8 r3da508c  
    4848      <itemizedlist>
    4949        <listitem>
     50          <para>[fernando] - Gparted from a menu: "ssh-askpass" and "pkexec".
     51          Fixes <ulink url="&blfs-ticket-root;4454">#4454</ulink>.</para>
     52        </listitem>
     53        <listitem>
    5054          <para>[igor] - Update to libisoburn-1.3.4. Fixes
    5155          <ulink url="&blfs-ticket-root;4451">#4451</ulink>.</para>
  • xsoft/other/gparted.xml

    rbef99d8 r3da508c  
    160160      application from the menu, further applications and configurations are
    161161      necessary. Examples of applications that may be used:
    162       <ulink url="http://people.debian.org/~kov/gksu">gksu and gksudo</ulink>,
     162      <ulink url="http://people.debian.org/~kov/gksu">gksu</ulink>,
    163163      <ulink url="https://launchpad.net/kdesudo">kdesudo</ulink>, or
    164164      <ulink url="https://github.com/tarakbumba/xdg-su">xdg-su</ulink>.
     165      Other solution is to use <application>pkexec</application>, from
     166      <xref linkend="polkit"/>, but some configuration is necessary.
    165167      Another simple solution is the <application>GTK+</application> based
    166       <application>gnome-ssh-askpass2</application> (does not need
    167       <application>GNOME</application>) that comes with
    168       <xref linkend="openssh"/>, under the
    169       <filename class="directory">contrib</filename> directory in the source.
    170     </para>
     168      <application>ssh-askpass</application> (does not need
     169      <application>GNOME</application>). Below, we describe these two
     170      alternatives: "ssh-askpass" and "pkexec".
     171    </para>
     172
     173    <sect3 role="ssh-askpass">
     174      <title>ssh-askpass</title>
     175        <para>
     176          To optionally use <application>ssh-askpass</application>, you need
     177          <xref linkend="sudo"/> and <xref linkend="openssh"/> to be installed.
     178          Uncompress the <xref linkend="openssh"/> tarball and, inside the
     179          source directory, install <application>ssh-askpass</application> by
     180          running the following commands:
     181        </para>
     182
     183<screen><userinput>cd contrib &amp;&amp;
     184make gnome-ssh-askpass2</userinput></screen>
     185
     186        <para>
     187          Now, as the <systemitem class="username">root</systemitem> user:
     188        </para>
     189
     190<screen role="root"><userinput>install -v -d -m755                  /usr/lib/openssh/contrib     &amp;&amp;
     191install -v -m755  gnome-ssh-askpass2 /usr/lib/openssh/contrib     &amp;&amp;
     192ln -sv -f contrib/gnome-ssh-askpass2 /usr/lib/openssh/ssh-askpass</userinput></screen>
     193
     194        <para>
     195          Still as the <systemitem class="username">root</systemitem> user,
     196          configure <xref linkend="gparted"/> and <xref linkend="sudo"/> to
     197          use <application>ssh-askpass</application>:
     198        </para>
     199
     200<screen role="root"><userinput>cp -v /usr/share/applications/gparted.desktop /usr/share/applications/gparted.desktop.back &amp;&amp;
     201sed -i 's/Exec=/Exec=sudo -A /'               /usr/share/applications/gparted.desktop      &amp;&amp;
     202
     203cat &gt;&gt; /etc/sudo.conf &lt;&lt; "EOF" &amp;&amp;
     204# Path to askpass helper program
     205Path askpass /usr/lib/openssh/ssh-askpass
     206EOF
     207chmod -v 0644 /etc/sudo.conf</userinput></screen>
     208
     209        <para>
     210         Now, clicking in the menu item for Gparted, a dialog appears in the
     211         screen, asking for the administrator password. Any graphical program
     212         requiring root privileges can be run using "sudo -A &lt;program&gt;",
     213         e.g. from a terminal, from a desktop launcher, or including it in the
     214         desktop file.
     215        </para>
     216
     217    </sect3>
     218
     219    <sect3 role="pkexec">
     220      <title>pkexec</title>
     221        <para>
     222          To optionally use <application>pkexec</application>, you need
     223          <xref linkend="polkit-gnome"/> or <xref linkend="lxpolkit"/>, and
     224          <xref linkend="consolekit"/> installed with support to
     225          <xref linkend="linux-pam"/> and <xref linkend="polkit"/>.
     226          As the <systemitem class="username">root</systemitem> user,
     227          configure <xref linkend="gparted"/> and <xref linkend="polkit"/> with
     228          the following commands:
     229        </para>
     230
     231<screen role="root"><userinput>cp -v /usr/share/applications/gparted.desktop /usr/share/applications/gparted.desktop.back &amp;&amp;
     232sed -i 's:/usr/sbin/gparted:/usr/sbin/gparted_polkit' /usr/share/applications/gparted.desktop &amp;&amp;
     233
     234cat &gt; /usr/sbin/gparted_polkit &lt;&lt; "EOF" &amp;&amp;
     235#!/bin/bash
     236if [ $(which pkexec) ]; then
     237    pkexec --disable-internal-agent "/usr/sbin/gparted" "$@"
     238else
     239    /usr/sbin/gparted "$@"
     240fi
     241EOF
     242chmod -v 0755 /usr/sbin/gparted_polkit</userinput></screen>
     243
     244        <para>
     245          Still as the <systemitem class="username">root</systemitem> user,
     246          configure <xref linkend="polkit"/> and <xref linkend="gparted"/> to
     247          use <application>pkexec</application>:
     248        </para>
     249
     250<screen role="root"><userinput>cat &gt; /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy &lt;&lt; "EOF"
     251&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     252&lt;!DOCTYPE policyconfig PUBLIC
     253 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
     254 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"&gt;
     255&lt;policyconfig&gt;
     256
     257  &lt;action id="org.freedesktop.policykit.pkexec.run-gparted"&gt;
     258    &lt;description&gt;Run GParted&lt;/description&gt;
     259    &lt;message&gt;Authentication is required to run GParted&lt;/message&gt;
     260    &lt;defaults&gt;
     261      &lt;allow_any&gt;no&lt;/allow_any&gt;
     262      &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
     263      &lt;allow_active&gt;auth_admin_keep&lt;/allow_active&gt;
     264    &lt;/defaults&gt;
     265    &lt;annotate key="org.freedesktop.policykit.exec.path"&gt;/usr/sbin/gparted&lt;/annotate&gt;
     266    &lt;annotate key="org.freedesktop.policykit.exec.allow_gui"&gt;true&lt;/annotate&gt;
     267  &lt;/action&gt;
     268
     269&lt;/policyconfig&gt;
     270EOF
     271chmod -v 0644 /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy</userinput></screen>
     272
     273        <para>
     274         Now, clicking in the menu item for Gparted, a dialog appears in the
     275         screen, asking for the administrator password. Any graphical program
     276         requiring root privileges can be run using "pkexec &lt;program&gt;",
     277         e.g. from a terminal, from a desktop launcher, or including it in the
     278         desktop file.
     279        </para>
     280
     281    </sect3>
     282
    171283  </sect2>
    172284
Note: See TracChangeset for help on using the changeset viewer.