LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-06-2010, 01:42 PM   #1
lewpatch
LQ Newbie
 
Registered: Apr 2006
Posts: 8

Rep: Reputation: 0
Set a user to noglin via ssh but allow su to iy


I would like to set a Linux user (RHEL 3.x and RHEL 5.x) to no
direct login via ssh but still allow an su to it from other accounts.

A Google hit suggests setting the shell for the user to /sbin/nologin, which, according to the Google hit, should not affect an su to the account.

I tried that and when I attempt an su to the account, the message
received is "This account is not currently available".

Would appreciate some help in getting this configuration to work.

Thank you.
 
Old 01-06-2010, 02:37 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,139

Rep: Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855
Quote:
Originally Posted by lewpatch View Post
I would like to set a Linux user (RHEL 3.x and RHEL 5.x) to no
direct login via ssh but still allow an su to it from other accounts.

A Google hit suggests setting the shell for the user to /sbin/nologin, which, according to the Google hit, should not affect an su to the account.

I tried that and when I attempt an su to the account, the message
received is "This account is not currently available".

Would appreciate some help in getting this configuration to work.

Thank you.
Try setting the DenyUsers directive in the sshd_config file. See options here:
http://linux.die.net/man/5/sshd_config

In your case, set the user up as normal, then add:
Code:
DenyUsers <username>@*
restart SSH. The user will get dropped from ANY network address, an attempt to login will be sent to syslog, but you'll still be able to log in as another user, then SU to the account.
 
1 members found this post helpful.
Old 01-07-2010, 11:09 AM   #3
lewpatch
LQ Newbie
 
Registered: Apr 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you - this technique worked fine - aprpeciate the help.
 
Old 01-07-2010, 12:43 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,139

Rep: Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855Reputation: 7855
Quote:
Originally Posted by lewpatch View Post
Thank you - this technique worked fine - aprpeciate the help.
No problem...glad it worked out.
 
  


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
How to set up ssh to allow users to ssh into the machine mrotsliah Linux - Server 14 06-03-2009 12:00 PM
User Creationg : ssh/sftp user jail to $HOME only routers Solaris / OpenSolaris 2 10-29-2007 11:28 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
Set group id,set user id? JAKK Slackware 3 06-15-2006 10:16 PM
How to view set-user-ID and set-group-ID Xris718 Linux - General 7 01-10-2004 01:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:24 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
Open Source Consulting | Domain Registration