ユーザ用ツール

サイト用ツール


サイドバー

最新の10件
一覧
unix:doas

doas

Install

Debian install(Debian sid amd64)

$ git clone https://github.com/slicer69/doas
$ cd doas/
$ make
$ fakeroot checkinstall --install=no
$ sudo dpkg -i ./doas_20191225-1_amd64.deb

Ubuntu Focal Fossa amd64 (development branch)

$ git clone https://github.com/slicer69/doas
$ cd doas/
$ make
cc -Wall -O2 -DUSE_PAM -DDOAS_CONF=\"/usr/local/etc/doas.conf\"  -D_GNU_SOURCE -include compat/compat.h -Icompat  -c -o doas.o doas.c
doas.c:48:10: fatal error: security/pam_appl.h: No such file or directory
   48 | #include <security/pam_appl.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: doas.o] Error 1
$ apt-file search security/pam_appl.h
libpam0g-dev: /usr/include/security/pam_appl.h
$ sudo apt install libpam0g-dev
$ make
$ fakeroot checkinstall --fstrans --install=no
$ sudo dpkg -i ./doas_20191225-1_amd64.deb

Raspbian buster armhf

$ git clone https://github.com/slicer69/doas
$ cd doas/
$ make
yacc parse.y
make: yacc: Command not found
make: *** [Makefile:55: y.tab.o] Error 127
$ sudo apt install bison
$ make
$ fakeroot checkinstall --install=no
$ sudo dpkg -i ./doas_20191225-1_armhf.deb

config file

/usr/local/etc/doas.conf

$ sudo install -o root -g root -m 600 /dev/null /usr/local/etc/doas.conf
$ sudo vi /usr/local/etc/doas.conf

alice アカウントユーザがroot権であらゆるコマンドを実行できる.パスワードは alice のものを入力する.

permit alice

wheell グループのユーザがroot権であらゆるコマンドを実行できる.パスワードは実行したユーザのものを入力する.

permit :wheel

wheel グループのユーザがパスワード無しでroot権であらゆるコマンドを実行できる

permit :wheel
permit nopass keepenv root

persist で認証が成功してからパスワードが5分間求められなくなる.

permit persist :wheel

tips

doasで実行したいコマンドのオプションをdoasが見てエラーとなる

doas: invalid option -- 'xxx'

以下のようにコマンドの前に -- を入れると良さそう

$ doas -- command option
$ man doas | grep '\ \-\-' -A1
     --          Any dashes after a combined double dash (--) will be interpreted as part of the command to be run or its
                 paramters. Not an argument passed to doas itself.

参考URL

コメント

コメントを入力. Wiki文法が有効です:
   ___    ___    ____   ___    __ 
  / _ \  / _ |  / __/  / _ \  / / 
 / // / / __ | _\ \   / ___/ / /__
/____/ /_/ |_|/___/  /_/    /____/
 
unix/doas.txt · 最終更新: 2023/07/13 04:55 by matoken