Solved

Restricting a Unix user

Posted on 2008-10-31
6
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

705 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