LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2008, 09:42 AM   #1
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Rep: Reputation: 0
postmap: Permission denied


I'm trying to use postmap to create a file to use for my virtual aliases for Postfix which I'm using Webmin to administer with. But whenever I issue the command postmap /etc/postfix/virtual I get the following error: -bash: /usr/sbin/postmap: Permission denied

I'm using Fedora 8 and logged in as root. Any ideas on this matter?
 
Old 08-08-2008, 11:08 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Code:
ls -l /etc/postfix/virtual
What are the permissions?
 
Old 08-08-2008, 02:12 PM   #3
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver View Post
Code:
ls -l /etc/postfix/virtual
What are the permissions?
-rw-r--r-- 1 root root 12494 2007-10-04 14:42 /etc/postfix/virtual
 
Old 08-08-2008, 06:02 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Run the command as root. Either log in as root, change users via su or sudo, or run:

sudo postmap /etc/postfix/virtual


Oops, sorry, I see you are root.

What is output of

ls -l /usr/sbin/postmap

Last edited by Mr. C.; 08-08-2008 at 06:04 PM.
 
Old 08-09-2008, 03:45 AM   #5
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mr. C. View Post
What is output of

ls -l /usr/sbin/postmap
-rwxr-xr-x 1 root root 177092 2007-10-04 14:43 /usr/sbin/postmap

I'm stumped because I've tried this on another machine and it's worked perfect. I've installed Postfix via yum and also through the webmin interface itself (also uses the yum command), but also installed the Postfix module on the webmin website.

Last edited by Mike65; 08-09-2008 at 03:47 AM.
 
Old 08-09-2008, 04:44 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Are you somehow running the postmap command from webmin, or from a terminal session?
 
Old 08-09-2008, 08:02 AM   #7
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
Are you somehow running the postmap command from webmin, or from a terminal session?
Trying to run this through SSH as I'm trying to setup the virtual db in order for Webmin to setup mailboxes in it's Virtualmin module when I create new sites. At the moment Virtualmin gives an error that it can't create the virtual mailboxes when I create a new site.

Mail for domain failed! : Failed to regenerate table /etc/postfix/virtual: at ../web-lib-funcs.pl line 982.
 
Old 08-09-2008, 08:14 PM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Reasons for Permission denied messages:
  • permissions of executable
  • permissions on path components leading to executable
  • binary resides on noexec file system
  • restricted shell
  • SElinux / AppArmor

So lets check a few more things:
Code:
ls -ld /usr/sbin
locate postmap | grep bin
mount
shopt  restricted_shell

Last edited by Mr. C.; 08-10-2008 at 06:12 PM. Reason: Updated list to include SeLinux/AppArmor
 
Old 08-10-2008, 06:05 AM   #9
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Original Poster
Rep: Reputation: 0
I appreciate the help and assistance of you all.

Quote:
Originally Posted by Mr. C. View Post
ls -ld /usr/sbin
drwxr-xr-x 2 root root 12288 2008-08-09 13:57 /usr/sbin


Quote:
Originally Posted by Mr. C. View Post
locate postmap | grep bin
/usr/sbin/postmap



Quote:
Originally Posted by Mr. C. View Post
mount
I just used the basic generated layout in the Fedora installation.

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)



Quote:
Originally Posted by Mr. C. View Post
shopt restricted_shell
restricted_shell off

Last edited by Mike65; 08-10-2008 at 06:07 AM.
 
Old 08-10-2008, 09:49 AM   #10
Mike65
LQ Newbie
 
Registered: Feb 2003
Location: England
Distribution: RedHat 8
Posts: 9

Original Poster
Rep: Reputation: 0
I appear to have solved this issue. I created a new basic install of Fedora 8, installed Postfix via Yum and still no luck with postmap, still getting permission errors. So I downloaded and installed Fedora 9 and success, it worked perfectly. Not sure why I received an error with a Fedora 8 install.

Thanks for your help all.

Last edited by Mike65; 08-10-2008 at 11:42 AM.
 
Old 08-10-2008, 12:17 PM   #11
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Sometimes its best just to update and move on to more pressing tasks. Glad you're up and running.
 
Old 08-10-2008, 05:09 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'd pu my money on an SELinux issue. Next time you have a similar problem, try rutning SELinux off with "setenforce 0", try the command and turn it back on with "setenforce 1"
 
Old 08-10-2008, 06:12 PM   #13
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Added SELinux/AppArmor the list above.
 
Old 08-10-2008, 06:22 PM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I bumbled around for age on a permissions issue yesterday and SELinux didn't even cross my mind until the very end. That was the issue of course.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 05:50 AM
Who are you?: Permission denied pankajsys.engg Linux - Server 1 12-07-2007 07:55 PM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 06:57 AM
Permission Denied dima789 Linux - Software 10 02-01-2006 01:33 AM
Permission Denied Viper Slackware 7 08-07-2002 09:22 PM


All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration