0

I'm trying to use the makemap hash command, but even as root it says Permission denied. Command i'm trying to run:

sudo makemap hash /etc/mail/authinfo/gmail-auth < /etc/mail/authinfo/gmail-auth
-bash: /etc/mail/authinfo/gmail-auth: Permission denied
Jojo01
  • 129
  • 7
  • The same reason you have difficulty with `sudo` and output redirection happens with input redirection `<` and `<<`, it is effected by the shell of the user calling sudo, not by `sudo`. – HBruijn Jul 29 '16 at 11:12
  • 2
    `sudo /bin/su -c "makemap hash /etc/mail/authinfo/gmail-auth < /etc/mail/authinfo/gmail-auth"` – HBruijn Jul 29 '16 at 11:15
  • @HBruijn Thanks please post that as answer and i'll validate. – Jojo01 Jul 29 '16 at 11:32
  • Please vote up on the answer(s) to to duplicate question. – HBruijn Jul 29 '16 at 11:41
  • sudo /bin/su -c "makemap hash /etc/mail/authinfo/gmail-auth < /etc/mail/authinfo/gmail-auth" makemap: error opening type hash map /etc/mail/authinfo/gmail-auth: Permission denied. That comment and solutions within the duplicate question no longer apply. (For me at least). – Tmanok Jan 02 '19 at 19:02
  • Fixed it by temporarily owning the entire mail directory after being a bit ticked. sudo chown -R root /etc/mail do the do with the hash making... sudo chown -R smmta /etc/mail – Tmanok Jan 02 '19 at 19:09

0 Answers0