LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-27-2011, 03:43 PM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
Running fetchmail as root


Hi all,

I run fetchmail to download all my emails from remote mail server to my linux server.

But every time when i run fetchmail -v i am getting a warning that

" Running as root is discouraged"

I just want to know whether it is unsecure to run fetchmail as root user.

Can anyone explain me the effects of running fetchmail as root.

Thanks in advance,
Dinesh.

Last edited by dinakumar12; 04-27-2011 at 03:44 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-27-2011, 04:10 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by dinakumar12 View Post
Hi all,
I run fetchmail to download all my emails from remote mail server to my linux server. But every time when i run fetchmail -v i am getting a warning that

" Running as root is discouraged"

I just want to know whether it is unsecure to run fetchmail as root user.
Obviously, or you wouldn't get that message.
Quote:
Can anyone explain me the effects of running fetchmail as root.

Thanks in advance,
Dinesh.
Yes...the man page for Fetchmail can shed some light, as can Google. From the man page:
Code:
...could open a security hole, because they pass text manipulable by an attacker to a shell command. Potential shell characters are 
replaced by '_' before execution. The hole is further reduced by the fact that fetchmail temporarily discards any suid privileges it 
may have while running the MDA. For maximum safety, however, don't use an mda command containing %F or %T when fetchmail is run from 
the root account itself.
 
2 members found this post helpful.
Old 04-28-2011, 07:54 AM   #3
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi TB0ne,

Thanks for your reply. I will now change my fetchmail process to own by user other than root.

But still i cant understand the risks involved in running fetchmail as root clearly. But i will google for that.

Thank you again.
 
Old 04-28-2011, 09:23 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by dinakumar12 View Post
Hi TB0ne,
Thanks for your reply. I will now change my fetchmail process to own by user other than root.

But still i cant understand the risks involved in running fetchmail as root clearly. But i will google for that.
Thank you again.
You can't?? Even after reading the piece from the man page I posted?

Think about it...fetchmail processes an email with a script attached. Again, reading the man page will explain things further, but if you're running as root, that script can do ANYTHING. Not running as root? It can't.
 
Old 04-28-2011, 11:59 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
dinakumar12, You need to think of this in terms of "what if this were to happen". See this CVE regarding Fetchmail. It is an example where a bug allowed a user to execute arbitrary code with the privilege of the user that Fetchmail is executing as. If you are running as root, the attacker would have root access to your machine and the data on the machine would now be forfeit.
 
1 members found this post helpful.
  


Reply



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
is suid disabled from running all scripts or just from running them as root monsteriname Programming 2 09-05-2009 02:57 AM
Running Fetchmail on IpCop Server? nilesf Linux - Networking 1 09-16-2004 11:05 AM
installed as root, running as non-root? daniela Linux - Newbie 4 09-09-2003 04:41 PM
Running fetchmail daemon automatically iihay Linux - General 3 09-02-2001 05:16 PM
Fetchmail fetches, but root gets all the mail... Justinw Linux - Networking 0 04-26-2001 03:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:19 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
Open Source Consulting | Domain Registration