LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-11-2005, 12:37 AM   #1
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Rep: Reputation: 15
File Permissions, Help Required!!!!


Hi

I need your kind help on executing a script.

I've created a automate script using EXPECT and placed the
script file in path "/usr/bin/SCRIPT" now i have given a
permission of read and execute to all users in a particular
group say "group - winner" now the user "winner" has a permission
of `rwx` and a user "john" of group "winner" has `rx" permission.

If the user john is logging in and providing a command "SCRIPT"
at the command prompt then the script start works but the user
can also view the file by providing command "cat /usr/bin/SCRIPT".

As the SCRIPT contains confidential information such as passwords etc,
the user "should not be able to view the contents of the SCRIPT" only
the user can execute the file.

Is there any solution for this issue.

I hope you will send me the solution.

Thanks in Advance
Bharani
 
Old 05-11-2005, 12:53 AM   #2
johnnybezak
Member
 
Registered: Oct 2003
Location: Bendigo, Australia
Distribution: Have used Yellow Dog, thinking Mandrake for X86 System
Posts: 46

Rep: Reputation: 15
So if i get this straight, you want the user to have execute permissions, but not read or write? If so do a
"chmod 711" that will give the owner read write execute, group and others execute only. Hope that helps,

tom
 
Old 05-11-2005, 01:22 AM   #3
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15
Hi John,

Thanks for your reply and also i belive that without a read permission
no executable in linux can be executed.

Please send me any other positive replies.
 
Old 05-11-2005, 06:01 AM   #4
grayFalcon
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 69

Rep: Reputation: 15
I think your problem can be solved by putting the passwords into a different file and having the script run as a different user.
Example: The script can be executed by group A, but runs with the permissions of user B. The password-file is only readable by user B.

Generally though I think that you should rather encrypt your passwords than hide them in such a way.
 
Old 05-11-2005, 12:01 PM   #5
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15
Hi Gray Falcon,

Thanks for your option, but any way if the user can access the script they can see the script
and also the PASSWD FILE so that they can easily view the passwd file by cat command.

Any way i Thankyou a lot for the precious reply. Now i've edited the users ".bashrc" file
using "alias", so all the options of viewing files is blocked.

Thank you once again.
Bharani
 
Old 05-16-2005, 08:50 AM   #6
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15
Query Again

Hi,

This is Bharani again, using .bashrc file i've blocked all the editors and viewers
now my problem is, i've added a script in path "/usr/bin/LOGINSCRIPT" and also
added a entry in file ".bashrc" using which the scripts starts automatically when
the user is logged in to system, but if the user press "Ctrl + C" the script stops
and user prompt appears but my query is if the user has pressed "Ctrl + C" the
terminal which the user has connected should be closed or logged out.

Is there any options ?


Thanks in Advance
Bharani
 
Old 05-17-2005, 02:57 AM   #7
grayFalcon
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 69

Rep: Reputation: 15
Hello!

Here's a fine tutorial on trapping signals from a script:

http://www.freeos.com/guides/lsst/ch04sec12.html

I still think that your method is not very safe though... have you blocked grep and awk for example? Both can be used to display the contents of a file too... And what about gcc or g++? There's so many commands that can show you what is in a file, I hardly think you can block them all. If you insist, you whould perhaps rather have a whitelist than a blacklist, but you'd really have to have very few entries.
 
  


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
Help Required on FILE PERMISSIONS!!! bharaniks Linux - Security 3 06-10-2005 12:08 PM
URL required for samba-common file br_sriram Linux - Software 1 09-18-2004 02:11 PM
Required File: libpthread.so.0 DaRk RuSs Linux - Software 7 07-15-2004 05:51 PM
changing file permissions(fast reply required) Xing Linux - Software 11 09-18-2003 11:44 PM
RFC - DNS - what is required in a zone file Bluesuperman General 0 02-25-2003 05:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:50 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
Open Source Consulting | Domain Registration