Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-08-2007, 04:39 AM
|
#1
|
Member
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114
Rep:
|
Disabling direct console login: forcing su
I wish to disallow direct console logon (on Linux, of course) to several previlige accounts, but instead want them to login as normal users and then do a su/sudo to login to a high privilege account.
Note: I do not wish to disable only root login which can be easily done via /etc/securetty
I did some research on Internet and found the following code snippet useful, but I am sure there could be a smarter way to do it.
/*
Ensure that the user's .profile/.bash_profile is only writable by root and readable by others and then add the following at the top:
### script begin ###
trap "" 1 2 3
REALUSER=`/usr/bin/who am i | /usr/bin/cut -f1 -d" "`
SUUSER=`id -un`
if [ "$REALUSER" = "$SUUSER" ]
then
logout
fi
### script end #####
*/
|
|
|
05-08-2007, 04:47 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
at a basic level use /etc/security/access.conf
|
|
|
05-08-2007, 04:54 AM
|
#3
|
Member
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114
Original Poster
Rep:
|
Dear Mod
Thanks for the info but please correct me if I am wrong. Is /etc/security/access.conf standard utility present on all *nix boxes or is it some kind of additional package.
A quick Googling [[ http://www.rhce2b.com/clublinux/RHCE-15.shtml]] revealed that it has to be used in conjunction with PAM. I think I have quite old servers, which might not support PAM, but I am not too sure.
|
|
|
05-08-2007, 05:02 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
totally standard file really.
|
|
|
05-09-2007, 01:10 AM
|
#5
|
Member
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114
Original Poster
Rep:
|
Thanks Chris
Problem Solved!
|
|
|
All times are GMT -5. The time now is 08:25 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|