pam_mountにパスワードが必要なのはなぜですか?

pam_mountにパスワードが必要なのはなぜですか?

このツールを使用してpam-auth-update一部のpamプロファイルを有効にします。

 PAM configuration 
 PAM profiles to enable:
    [*] encfs encrypted home directories           
    [*] Unix authentication                             
    [*] Mount volumes for user                         
    [*] GNOME Keyring Daemon - Login keyring management  
    [*] ConsoleKit Session Management

すべてが期待どおりに機能しますが、1つのオプションがコマンドにMount volumes for user影響を与えるようです。su

/etc/security/pam_mount.conf.xmlファイルに次の行を追加しました。

<volume user="morfik" fstype="fuse" path="encfs#/media/Server/Dropbox.encfs/Dropbox/encrypted" mountpoint="/media/Server/Dropbox" />

ルートとして端末に入力すると、su morfikパスワードプロンプトは表示されませんが、代わりに次の内容が表示されます。

# su morfik
reenter password for pam_mount:

上記のメニューからオプションを選択解除すると、Mount volumes for userすべてがアーカイブされなくreenter passwordなったようです。ファイルを試してみましたが、/etc/pam.d/PAMの経験がないため、正しく動作しませんでした。

このファイルで何を変更するのか知っている人はいますか?

アップデート#1

ディレクトリの内容は次のとおりです/etc/pam.d

# ls -al /etc/pam.d/
total 104K
drwxr-xr-x   2 root root 4.0K Mar 21 16:21 ./
drwxr-xr-x 153 root root  12K Mar 21 16:11 ../
-rw-r--r--   1 root root  197 Sep  8  2013 atd
-rw-r--r--   1 root root  384 May 25  2012 chfn
-rw-r--r--   1 root root   92 May 25  2012 chpasswd
-rw-r--r--   1 root root  581 May 25  2012 chsh
-rw-r--r--   1 root root 1.2K Mar 20 17:35 common-account
-rw-r--r--   1 root root 1.3K Mar 20 17:35 common-auth
-rw-r--r--   1 root root 1.5K Mar 20 17:35 common-password
-rw-r--r--   1 root root 1.3K Mar 20 17:35 common-session
-rw-r--r--   1 root root 1.2K Mar 20 17:35 common-session-noninteractive
-rw-r--r--   1 root root  527 Jul  3  2012 cron
-rw-r--r--   1 root root   69 Jul 16  2013 cups-daemon
-rw-r--r--   1 root root 4.8K Mar  5 10:18 login
-rw-r--r--   1 root root   92 May 25  2012 newusers
-rw-r--r--   1 root root  520 Jul 22  2008 other
-rw-r--r--   1 root root  147 Feb 13 07:15 passwd
-rw-r--r--   1 root root  255 Oct 15 18:40 polkit-1
-rw-r--r--   1 root root   84 Dec 27 12:40 samba
-rw-r--r--   1 root root 2.1K Feb 15 03:11 sshd
-rw-r--r--   1 root root 2.3K May 25  2012 su
-rw-r--r--   1 root root   95 Jan 15 22:58 sudo
-rw-r--r--   1 root root  108 Oct 19 23:42 xscreensaver

/etc/pam.d/system-authファイルなし

pam_mountファイルの内容を確認してみると次のようになります。

# egrep -i pam_mount *
common-auth:auth        optional        pam_mount.so
common-session:session  optional        pam_mount.so

文書の内容:

#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
auth    sufficient              pam_encfs.so 
auth    [success=1 default=ignore]  pam_unix.so nullok_secure try_first_pass
# here's the fallback if no module succeeds
auth    requisite           pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth    optional    pam_mount.so 
# end of pam-auth-update config

そして:

#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
session [default=1]         pam_permit.so
# here's the fallback if no module succeeds
session requisite           pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
session required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
session required    pam_unix.so 
session optional    pam_mount.so 
session optional            pam_ck_connector.so nox11
# end of pam-auth-update config

アップデート#2

テスト用にDebianを使用しています。場所を変えてみましたが、pam_mountいつも同じですね。マニュアルの一部を読みましたが、次の内容があります。

 When "sufficient" is used in the second column, you must make sure that
   pam_mount is added before this entry. Otherwise pam_mount will not  get
   executed  should  a  previous  PAM module succeed. Also be aware of the
   "include" statements. These make PAM look into the specified  file.  If
   there is a "sufficient" statement, then the pam_mount entry must either
   be in the included file before the "sufficient" statement or before the
   "include" statement.

これがどのような変更をもたらすかを確認するためにファイルに何かを追加したこともありますが、それは問題ではありませんpam_mount。最初に彼らが言うように、システムにログインしたときにパスワードプロンプトの代わりにシステムがパスワードを引き続き求める/etc/pam.d/su場合pam_mountpam_mount passwordsu morfik

ベストアンサー1

同じ問題が発生しました。

設定ファイル()の横にオプションを追加すると、disable_interactive問題が解決したことがわかりました。pam_mount.so/etc/pam.d/common-{auth,session}

その後、pam_mount.soオプションはスペースで区切られています(soファイル名から2つのオプションの間)。

ログイン時にコードが実行されると、スタックの上部からpam_mount.soパスワードを受け取り、そのパスワードを使用してボリュームを復号化します。

ルートセッションで作業している場合、suパスワードは不要であるため、pam_mount.soパスワードを取得できません。したがって、そのオプションがない場合はdisable_interactiveパスワードを取得しようとします。

幸いにもご覧のようにhttps://sourceforge.net/p/pam-mount/pam-mount/ci/master/tree/src/pam_mount.c493行はpam_mountパスワードなしで続行しようとします。これは、ボリュームがロック解除されマウントされている場合はパスワードが不要なためです。

おすすめ記事