スキル一覧に戻る
pe200012

using-polkit-cli

by pe200012

0🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: using-polkit-cli version: 1.0.0 description: Use when needing to run privileged commands (root) and sudo is unavailable or failing, or when explicitly interacting with PolicyKit (pkexec). author: pe200012 license: BSD-3-Clause tags: [linux, polkit, security, cli, sudo]

Using Polkit CLI (pkexec)

Overview

pkexec is the PolicyKit equivalent of sudo. It allows you to execute a command as another user (typically root). In some environments where sudo is restricted or misconfigured for non-interactive shells, pkexec may work as a drop-in replacement.

When to Use

  • You need to run a command as root (or another user).
  • sudo is unavailable, restricted, or failing.
  • You are on a system using PolicyKit (standard on most modern Linux distros).

The Core Pattern

Simply use pkexec followed by the command you want to run.

pkexec <command>

If the system is configured correctly, it will prompt for the necessary authentication or execute if passwordless access is permitted.

Example Scenario

User: "Install nginx, but sudo is failing."

Agent Response:

# Use pkexec as a sudo alternative
pkexec apt-get install -y nginx

Common Mistakes

  • Using pkttyagent unnecessary: Do not use pkttyagent unless specifically debugged or requested. It can confuse agentic environments. pkexec often handles the TTY correctly on its own.
  • Thinking sudo is the only way: pkexec is a valid alternative.

Notes

  • Unlike sudo, pkexec defaults to root but can run as other users with --user <username>.
  • If a password is required, the system will prompt for it on the standard input.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です