LinuxQuestions.org
Register a domain and help support LQ
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-01-2009, 12:59 PM   #1
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Rep: Reputation: 34
How to password protect an app...


I maybe am posting this in the wrong section, I am not sure.

Is there a way to protect an app to where it will require a password? This machine has one user that is used by more than one person. I have it as one user just to save time because people switch off using it all of the time, but I have one application that I would like only certain people to have access to. How would I do this?
 
Old 05-01-2009, 01:44 PM   #2
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Ubuntu
Posts: 794

Rep: Reputation: 56
Since you said "certain people" I'm assuming that means more than one, so here's how I'd do it. If somebody has a better solution feel free to post it, I don't claim to be a Linux expert, I've been using it off and on for years and I learn something every day.

1) Locate the binary executable, probably in /usr/bin or /bin or some similar location. It's the binary file that all the shortcuts point to that actually launches the application.
2) Create a group just for launching this application. Add only users you want to launch the application to the group.
3) Modify ownership of the binary file for the app so that your new group is now the owning group, and that you are the owner, and that "others" have no access to it at all.

Code:
sudo chgrp groupname binaryfilename
sudo chmod 770 binaryfilename
 
Old 05-01-2009, 02:32 PM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,275

Rep: Reputation: 126Reputation: 126
Quote:
Originally Posted by Quads View Post
This machine has one user that is used by more than one person.
If you're going to give up all effective control of your machine, you have to expect bad things to happen. It doesn't take all that long to log out and have someone else log in. Add some more users.
 
Old 05-02-2009, 09:43 AM   #4
Quads
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Fedora, Ubuntu, Slackware
Posts: 203

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Quakeboy02 View Post
If you're going to give up all effective control of your machine, you have to expect bad things to happen. It doesn't take all that long to log out and have someone else log in. Add some more users.
This is true, however when it is a lot of people who need to use the machine, that is a lot of logging in and out.

I considered just adding a second user, and all of the people who require access could log on as that user, but then it is still logging in and out a lot. I think I'll give the group idea a shot and see how that works first.
 
Old 05-02-2009, 12:17 PM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,614

Rep: Reputation: 440Reputation: 440Reputation: 440Reputation: 440Reputation: 440
Quads:

Advices above are based on sound principles: it is really important to use several usernames for security reasons.

The most common solution to your request is given by dudeman41465 above. Its philosophy is this:

"Create a group of users that are permitted to the executable and have the ownership belong to them alone."

sudo chmod 750 /bin/my_executable.sh

Goodluck.
 
  


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
Password protect souvik Programming 3 11-06-2015 02:35 PM
How do you password protect a .pdf? cheeseandpenguins General 8 05-07-2015 07:50 AM
How do I password protect a HD? randell6564 Ubuntu 3 10-31-2006 02:03 PM
Password protect directorys? xconspirisist Linux - Security 3 12-31-2004 09:26 PM
how to password protect certain directories? sirpelidor Linux - Security 3 10-06-2004 01:16 PM


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