LinuxQuestions.org
Review your favorite Linux distribution.
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 03-27-2008, 02:23 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
how to set permission to this file?


Hi,

How can I set with a file with the following attribute.
" -rwsr-sr-s "

-rwsr-s--x 1 oracle dba 106M Aug 25 2002 oracle.

Thanks in advance.
 
Old 03-27-2008, 03:07 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by ZAMO View Post
How can I set with a file with the following attribute.
" -rwsr-sr-s "
It is not possible: it can be set for user and group only. These are the SUID and SGID respectively: they allow users to run an executable with the permissions of the file owner or group. Setting the permission for the world (other) does not make sense.
 
Old 03-27-2008, 03:46 AM   #3
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
colucix,

Yes , I want to execute sqlplus as user username(valid user) with the DBA credentials. It shows me the following error.
$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 27 14:15:21 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: username
Enter password:
ERROR:
ORA-01034: Message 1034 not found; No message file for product=RDBMS,
facility=ORA
ORA-27121: Message 27121 not found; No message file for product=RDBMS,
facility=ORA
Linux-x86_64 Error: 13: Permission denied


So, we need to set the permission as above, as we have other servers already up and running with the same " -rwsr-sr-s " permissions.
Can I get the option for chmod to do that.


Thank you
 
Old 03-27-2008, 03:58 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
did you try chmod u=rws,g=rs,o=rs <file>
 
Old 03-27-2008, 04:08 AM   #5
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Nathanael,

I got "-rwSr-Sr-s " , when I try with chmod u=rws,g=rs,o=rs <file>.

SORRY A CORRECTION : I want to set permission as "-rwsr-s--x "

Thanks
 
Old 03-27-2008, 05:17 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The uppercase S means that the SUID and/or SGID are set but the executable permission is not. You have to do
Code:
chmod +x file
Then, if you want permission -rwsr-s--x you have to do
Code:
chmod o-rs file
or use the octal codes to set all the permissions you want in one shot
Code:
 chmod 6751 file
 
Old 04-02-2008, 03:09 AM   #7
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Thank you colucix
 
  


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
How to set permission of a file created by java? emanresu Linux - General 4 01-23-2008 01:54 AM
How can set execute permission. deepak_message Linux - Software 3 11-03-2007 09:22 AM
unable to set permission sunlinux Linux - General 4 02-18-2007 11:00 PM
Can I set default file/directory permission levels? toes Linux - Security 5 01-05-2007 06:21 PM
can't set leading "s" in file permission toddcurry Linux - General 2 10-19-2006 05:34 PM

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

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