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 11-02-2012, 08:41 AM   #1
yaximik
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 0
different root privileges?


Hi,

I was installing PostgreSQL following instructions and encountered a strange problem. Here is the short version:

Code:
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
I stumbled upon chown not changing the ownership of the directory just created with any chown options. To do so, I had to logout from my user acct and login as root, and use Gnome GUI to change ownership of the directory (Properties>Permissions). Do root privileges differ depending on the way root acct is accessed?
 
Old 11-02-2012, 09:52 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,361
Blog Entries: 12

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
To an extent.

su gives you the privileges of the user you are switching to. If no user is specified, it defaults to root.

su - loads the environment of the user you are switching to.

If you use su, you get root privileges, but not root's environment, including the PATH variable.

I've never used postgres.

Does it create a "postgres" user? I would expect su - postgres to switch to the user, "postgres." I'm frankly curious.
 
  


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
How to give only certain root privileges linuxfia Ubuntu 3 06-01-2009 12:35 PM
Ssh root privileges gabsik Linux - Security 1 05-28-2008 11:19 PM
mkdir with root privileges slam Programming 3 09-29-2006 06:22 PM
root privileges and permissions evil_lafta Slackware 7 08-20-2003 10:37 PM
Xine and root privileges markus1982 Linux - Software 1 08-18-2003 04:23 PM


All times are GMT -5. The time now is 08:36 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