Solved

Restricting a Unix user

Posted on 2008-10-31
6
375 Views
Last Modified: 2013-12-27
Hello Experts,

How can I restrict an OS user to login for more than once. For example I want to restrict Operating System user named 'oracle' to open multiple shell terminals, he could only be able to login once from telnet only. If I'm logged in to Oracle Database Server using telnet from workstation (client) A at the same time an other person is also trying to log in to Oracle database server from workstation B with the same OS user 'oracle' then the person B should receive a message that "You cannot be logged in with this user...".

I want to implement this restriction using bash shell script, at Sun Solaris.

Kind Regards,

sonicefu
0
Comment
Question by:sonicefu
  • 2
  • 2
  • 2
6 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 400 total points
ID: 22855856
In the Oracle .bash_profile, put

if [ `w | grep -c [o]racle` -gt 1 ]
then
     echo "You cannot be logged in with this user...."
     exit
fi


0
 
LVL 13

Author Comment

by:sonicefu
ID: 22855923
Thanks a lot !

How can I implement if for multiple users ? is there any dynamic way

oracle
root
ora_dba
0
 
LVL 48

Expert Comment

by:Tintin
ID: 22855927
You said you wanted this for the 'oracle' user.  How many users do you want it for?
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 13

Author Comment

by:sonicefu
ID: 22855932
Sorry, I can send it in an other question, should I ?

I need it dynamic, if I make it a file having list of users to restrict will it work and how ?
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 22856956
I wouldn't do it for root. If someone is logged in and you need to get on for some type of maintenance you might have a problem.

0
 
LVL 11

Assisted Solution

by:jgiordano
jgiordano earned 100 total points
ID: 22856986
If it is the latest rev of solaris 10 (update 5) you may be able to use resource control

http://blogs.sun.com/darren/entry/limiting_users_to_one_login
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question