0

I want to run several commands as root after my eCryptfs is mounted on my login. Can I somehow set a hook for that? Can I do it with systemd?

What I want to achieve is to mount automatically on login a disk image that lays in the encrypted home directory.

1 Answer 1

0

An already encrypted home? Then you can use the regular "run at login" methods but using sudo, like:

4
  • No, the fact is that I want to run the command as root, and I'm not mistaken mount of eCryptfs if done with root privileges, so if I can just call it in the same context I'll get what I need. I want to run it as root, but I want to run it after eCryptfs mount. That's the complexity.
    – nun4ak
    Jan 1, 2016 at 8:07
  • Are you familiar with sudo? It can run things as root, called by authorized users, and these methods are designed to run after the user logs in. What's stopping them from working?
    – Xen2050
    Jan 1, 2016 at 14:15
  • sudo asks for a password and I want it to be automatic with no user interference, is it possible?
    – nun4ak
    Jan 2, 2016 at 20:03
  • You can configure sudo to not ask for a password, for all or only a few commands. Check it's man pages and I'm sure there are answers about it on this site too. Good luck!
    – Xen2050
    Jan 3, 2016 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .