Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th July 2010, 04:26
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to edit files as admin user

I installed the following dist for system users only The_Perfect_Server_-_Ubuntu_Lucid_Lynx_(Ubuntu_10_04)_[ISPConfig_2]
Here is a problem I am running into:
I don't allow root to ssh in to my mail server. I log in with another admin ID and do sudo su. However, anytime I try to run the commands below I get and error about not being able to edit a read only file.

vi /etc/postfix/virtusertable

/etc/init.d/postfix restart


The only workaround I have found is to add my admin user ID to the root group or to allow root to ssh and run the commands. When lookink at the file system it shows root as the owner of the files I believe
Reply With Quote
Sponsored Links
  #2  
Old 8th July 2010, 13:49
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

What's the output of
Code:
whoami
when you get that error? What's the output of
Code:
ls -la /etc/postfix/
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 8th July 2010, 21:25
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What's the output of
Code:
---------
whoami

administrator

when you get that error? W10: Warning : Changing a readonly file

What's the output of
Code:
---------
ls -la /etc/postfix/
---------
total 108
drwxr-xr-x 4 root root 4096 2010-07-06 09:52 .
drwxr-xr-x 88 root root 4096 2010-07-06 17:23 ..
-rw-r--r-- 1 root root 318 2010-06-28 16:35 dynamicmaps.cf
-rw-r--r-- 1 root root 72 2010-06-28 17:35 local-host-names
-rw-r--r-- 1 root root 1841 2010-06-28 17:51 main.cf
-rw-r--r-- 1 root root 5301 2010-06-28 16:35 master.cf
-rw-r--r-- 1 root root 18992 2010-02-18 00:38 postfix-files
-rwxr-xr-x 1 root root 8729 2010-02-18 00:38 postfix-script
-rwxr-xr-x 1 root root 24256 2010-02-18 00:38 post-install
drwxr-xr-x 2 root root 4096 2010-06-28 16:40 sasl
drwxr-xr-x 2 root root 4096 2010-06-28 16:44 ssl
-rw-r--r-- 1 root root 395 2010-07-06 09:51 virtusertable
-rw-r--r-- 1 root root 12288 2010-06-28 17:51 virtusertable.db


I also can't run these commands as administrator
postmap /etc/postfix/virtusertable
/etc/init.d/postfix restart

I know that root is the owner. Do I need to change the owner of these files and if so how? I am also unable to reboot system as administrator



Thanks
Reply With Quote
  #4  
Old 9th July 2010, 10:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Quote:
Originally Posted by Happy View Post
What's the output of
Code:
---------
whoami

administrator
It should show root after you run
Code:
sudo su
Does sudo su show any errors?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 9th July 2010, 14:27
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure what logs to look in for the errors if there are any? As far as errors when I run the command sudo su and input my password. It seems to look normal.
Reply With Quote
  #6  
Old 10th July 2010, 11:30
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

I'd enable the root account. You can disable direct root logins in SSH for security reasons so that you have to use su to become root.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 10th July 2010, 20:45
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok I have always had root enabled. I did disable ssh for root. My question is how do I eleveate to root since I disabled ssh for root?
Reply With Quote
  #8  
Old 11th July 2010, 19:21
learnbash learnbash is offline
Junior Member
 
Join Date: Jul 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Happy View Post
ok I have always had root enabled. I did disable ssh for root. My question is how do I eleveate to root since I disabled ssh for root?

I think you are asking about.

Code:
  sudo su -
Reply With Quote
  #9  
Old 11th July 2010, 23:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Quote:
Originally Posted by Happy View Post
ok I have always had root enabled. I did disable ssh for root. My question is how do I eleveate to root since I disabled ssh for root?
Log in as a normal user and the run
Code:
su
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 12th July 2010, 04:04
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

ok let's say my administrator user login is joe, not administrator. after ssh into box I ran the command sudo -l and it said my user joe had all rights. However, I still can't edit files owned by root. Any ideas?I don't want to enable my root account to ssh in

Thanks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
pure-ftpd / MySQL on Fedora 12 - user limit Tek12 HOWTO-Related Questions 2 28th December 2009 12:51
Allow admin to modify "ROOT" owner files plathw Installation/Configuration 1 17th November 2009 09:28


All times are GMT +2. The time now is 19:18.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.