Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-11-2014, 11:37 PM
|
#1
|
Member
Registered: May 2011
Posts: 562
Rep: 
|
Which privilege to add to user
Hi,
It means huamin user below, is not able to access the folder,
[huamin@CentOS65x64 ~]$ cd /var/lib/pgsql/data/
bash: cd: /var/lib/pgsql/data/: Permission denied
[huamin@CentOS65x64 ~]$ su
Password:
[root@CentOS65x64 huamin]# cd /var/lib/pgsql/data/
[root@CentOS65x64 data]#
then which privileges should be added to "huamin"?
|
|
|
07-12-2014, 06:53 AM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
The 'su' command has a manual page. Please read 'man su', configure, test and then ask.
|
|
|
07-12-2014, 03:24 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
command ls -l should show the user, owner and group. chmod would allow the user to access the files or folders.
|
|
|
07-13-2014, 04:32 PM
|
#4
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,184
|
For postgres SQL data, you probably do not want to assign permissions to anyone beyond those that the Postgres configuration already uses!
STOP and read the Postgres documentation ... thoroughly. Do not do anything further, until you have done so.
|
|
|
07-13-2014, 11:00 PM
|
#5
|
Member
Registered: May 2011
Posts: 562
Original Poster
Rep: 
|
Jefro,
"pqsql" is now having this
drwx----w-. 4 postgres postgres 4096 Jul 11 17:36 pgsql
what privilege should be added to the user, to be able to access this folder?
|
|
|
07-13-2014, 11:14 PM
|
#6
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,347
|
Quote:
Originally Posted by Huamin
Jefro,
"pqsql" is now having this
drwx----w-. 4 postgres postgres 4096 Jul 11 17:36 pgsql
what privilege should be added to the user, to be able to access this folder?
|
Those permissions must be
Code:
drwx------ postgres postgres
You should NEVER grant any other user permission to access that directory!
Postgresql will refuse to start if you change those permissions!
Why would you want huamin user to access that directory?
|
|
|
07-14-2014, 03:15 AM
|
#7
|
Member
Registered: May 2011
Posts: 562
Original Poster
Rep: 
|
why I want to adjust the privilege to the user on the folder, is due to that I encounter this problem below, to start Postgresql.
[huamin@CentOS65x64 ~]$ postgres -D /usr/local/pgsql/data
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory
what to adjust then?
|
|
|
07-14-2014, 09:11 AM
|
#8
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,385
|
Quote:
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory
|
That is not a permissions issue. In your initial post you tried to access a file as a normal user and were denied. You then were able to access as root without a permission denied. Other members have explained that you should use postgres user to access. The error above is telling you that particular file does not exist which is another issue. I'm not familiar with postgres but someone should be along to give you some advice.
|
|
|
07-14-2014, 04:50 PM
|
#9
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,347
|
Quote:
Originally Posted by Huamin
why I want to adjust the privilege to the user on the folder, is due to that I encounter this problem below, to start Postgresql.
[huamin@CentOS65x64 ~]$ postgres -D /usr/local/pgsql/data
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory
what to adjust then?
|
That is a whole different problem/question from that in your original post.
I suspect that you have never initialized postgresql at all - hence no configuration or data files...
See man {postgres,initdb} for how to initialize and start your version of postgresql properly.
But I would stress once more, if you have changed directory permissions along that path, postgresql will refuse to start and write something like the following to the postgres log file:
Code:
FATAL: data directory "/var/lib/pgsql/data" has group or world access
DETAIL: Permissions should be u=rwx (0700).
Last edited by astrogeek; 07-14-2014 at 04:52 PM.
|
|
|
All times are GMT -5. The time now is 11:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|