LinuxQuestions.org
Review your favorite Linux distribution.
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 05-07-2007, 08:18 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
Ownership, group and premission changing problem


How do I change the ownership, group and the premission of files like:
Code:
lrwxrwxrwx 1 root root 41 Jan 28 07:20 default_pref -> ../../../../etc/squirrelmail/default_pref
If I try:
Code:
chown apache default_pref
chgrp apache default_pref
chmod 600 default_pref
Nothings happens!

Please help me!
 
Old 05-07-2007, 08:28 AM   #2
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Are you sure you are doing this as root?

Also make sure you first cd to the directory that contains the file you want to set permissions on.
 
Old 05-07-2007, 08:35 AM   #3
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 80
Quote:
lrwxrwxrwx 1 root root 41 Jan 28 07:20 default_pref
Why do you need to change the permissions on a symbolic link?
Quote:
../../../../etc/squirrelmail/default_pref
The real permissions are on the target file.

"The file-system permissions on the symbolic (or soft) link have no relevance: the permissions set on the file to which the symlink points control the access rights."
http://en.wikipedia.org/wiki/Symbolic_link
 
Old 05-07-2007, 08:41 AM   #4
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Yes I am root.

Quote:
Also make sure you first cd to the directory that contains the file you want to set permissions on.
You think to go into the directory that contains the file with the command CD?

I forget to say something.
When I do anything (chmod, chown, chgrp) with that file, another file has been changing (/etc/squirrelmail/default_pref).
For example if I want to change the ownership of the file /var/lib/squirrelmail/prefs/default_pref from root to apache, this file doesn't change but the file /etc/squirrelmail/default_pref changes.
 
Old 05-07-2007, 08:45 AM   #5
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Hi bsdunix!

Quote:
Why do you need to change the permissions on a symbolic link?
Because I can't use squirrelmail (webmail). When I want to see mails and type username and password to login I get the following error:

Code:
Error
Error opening /var/lib/squirrelmail/prefs/default_pref
Could not create initial preference file!
/var/lib/squirrelmail/prefs/ should be writable by user apache
Please contact your system administrator and report this error.

Last edited by gubak; 05-07-2007 at 08:46 AM.
 
Old 05-07-2007, 09:21 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
chmod 775 /var/lib/squirrelmail/prefs?
 
Old 05-07-2007, 09:28 AM   #7
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 80
Quote:
/var/lib/squirrelmail/prefs/ should be writable by user apache
chown apache /var/lib/squirrelmail/prefs?
 
Old 05-07-2007, 04:39 PM   #8
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
You need to change the permissions of the file the link points to.
 
Old 05-08-2007, 01:23 AM   #9
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Whatever I do I have the same problem.
So one more time:

Squirrelmail is installed. As soon as I go to www.mydomain.com/webmail the squirrelmail login page appears. I type the password and username, but when I click on the submit button I get an error:

Quote:
Error opening /var/lib/squirrelmail/prefs/default_pref
Could not create initial preference file!
/var/lib/squirrelmail/prefs/ should be writable by user apache
Please contact your system administrator and report this error.
The directory /var/lib/squirrelmail/prefs/ owned by apache and is in apache group. The premission is 775.
/var/lib/squirrelmail/prefs/default_pref is a symbolic link to the /etc/squirrelmail/default_pref. The file /etc/squirrelmail/default_pref is owned by apache and is in apache group. The file premission is 775.

This problem happening at every user.

Does somebody have any ideas?

Thanks in advance!

Last edited by gubak; 05-08-2007 at 01:25 AM.
 
Old 05-08-2007, 02:29 AM   #10
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
http://lists.olug.org/pipermail/olug...er/006588.html
 
  


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
Group Permissions and Ownership of files and folders bugeyemonster Linux - General 1 04-19-2006 02:52 AM
changing ownership and group of multiple files.. utanja Debian 3 02-21-2005 07:10 PM
changing the ownership djh Slackware 3 11-08-2004 05:16 AM
unable to modify ownership or group as root bubblehead Linux - Newbie 0 11-24-2003 10:15 PM
changing users and group ownership dkc_ace Linux - General 4 02-03-2003 08:50 PM


All times are GMT -5. The time now is 06:42 AM.

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