Solved

Restricting a Unix user

Posted on 2008-10-31
6
373 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
Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

 
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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

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

The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now