<div dir="ltr"><div dir="ltr" class="gmail_msg">I'm sorry. I'll try to explain my problem better.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Short version: Cron jobs cannot access the content of the encrypted disk even when I'm logged in. I can access the content of the disk from bash or graphical file explorer.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Longer version:</div><div class="gmail_msg">I've first seen problem because I'm using backintime to perform automatic backup of my disk. When I run the backup manually everything is fine, while when the backup is performed automatically with cron the resulting backup is always empty.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Adding the follwing command to crontab (using crontab -e), in order to list the content of the drive (/media/dataHD), show me that the ls of the drive doesn't produce any result.</div><div class="gmail_msg"><pre style="box-sizing:border-box;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-radius:3px;color:rgb(51,51,51)" class="gmail_msg"><code style="box-sizing:border-box;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:11.9px;padding:0px;margin:0px;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;background-color:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal" class="gmail_msg">*/1 * * * * ls -la /media /media/dataHD /media/dataHD/work > /tmp/filelist</code></pre><br class="gmail_msg"></div><div class="gmail_msg">I've the following configuration files (based on this guide <a href="https://wiki.archlinux.org/index.php/Talk:Pam_mount">https://wiki.archlinux.org/index.php/Talk:Pam_mount</a>):</div><div class="gmail_msg"><br></div><div class="gmail_msg">/etc/pam.d/pammount (I've created this file)</div><div class="gmail_msg"><span style="font-family:monospace" class="gmail_msg"><br class="gmail_msg"></span></div>#%PAM-1.0 <br class="gmail_msg"><br class="gmail_msg">auth      optional                   pam_mount.so <br class="gmail_msg">password  optional                   pam_mount.so <br class="gmail_msg">session   optional                   pam_mount.so<div class="gmail_msg"><br class="m_-2584202530360875353inbox-inbox-Apple-interchange-newline gmail_msg"></div></div>/etc/pam.d/system-local-login<div><span style="font-family:monospace">#%PAM-1.0
<br>
<br>auth      include   system-login
<br>auth      include   pammount
<br>account   include   system-login
<br>account   include   pammount
<br>password  include   system-login
<br>password  include   pammount
<br>session   include   system-login
<br>session   include   pammount</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">/etc/pam.d/sddm</span></div><div><span style="font-family:monospace"><br>
</span><span style="font-family:monospace">#%PAM-1.0
<br>
<br>auth        include     system-login
<br>auth            include         pammount
<br>account     include     system-login
<br>account         include         pammount
<br>password    include     system-login
<br>password        include         pammount
<br>session     include     system-login
<br>session         include         pammount<br>
<br>I hope I've been more clear now.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Thanks</span></div><div><span style="font-family:monospace"><br></span><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Sun, Oct 9, 2016 at 8:16 AM Thorsten Kukuk <<a href="mailto:kukuk@suse.de" class="gmail_msg" target="_blank">kukuk@suse.de</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Oct 08, Simone Gaiarin wrote:<br class="gmail_msg"><br><br class="gmail_msg"><br>> pam_mount decrypt the disk using the password the user input in the login<br class="gmail_msg"><br>> screen of the OS. Now in the moment I'm logged in and the disk is decrypted<br class="gmail_msg"><br>> how can I make cron see the disk? I'm not interested in having cron running<br class="gmail_msg"><br>> jobs when I'm not logged in (and so the disk is encrypted).<br class="gmail_msg"><br><br class="gmail_msg"><br>At the moment, where your user is logged in, everybody can see<br class="gmail_msg"><br>the disk, even cron. No pam_mount is needed there for cron.<br class="gmail_msg"><br><br class="gmail_msg"><br>Maybe you should explain at first what your problem exactly is<br class="gmail_msg"><br>and not start with a solution first?<br class="gmail_msg"><br><br class="gmail_msg"><br>  Thorsten<br class="gmail_msg"><br><br class="gmail_msg"><br>--<br class="gmail_msg"><br>Thorsten Kukuk, Senior Architect SLES & Common Code Base<br class="gmail_msg"><br>SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany<br class="gmail_msg"><br>GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)<br class="gmail_msg"><br><br class="gmail_msg"><br>_______________________________________________<br class="gmail_msg"><br>Pam-list mailing list<br class="gmail_msg"><br><a href="mailto:Pam-list@redhat.com" class="gmail_msg" target="_blank">Pam-list@redhat.com</a><br class="gmail_msg"><br><a href="https://www.redhat.com/mailman/listinfo/pam-list" rel="noreferrer" class="gmail_msg" target="_blank">https://www.redhat.com/mailman/listinfo/pam-list</a><br class="gmail_msg"><br></blockquote></div></div></div>