LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 02-25-2011, 01:57 PM   #1
cehgopal
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Question Disable remote login for particular user?


i want to disable the remote login for particular user id in linux server. can you please on this ASAP.

Thanks
 
Old 02-25-2011, 01:58 PM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and Welcome to LinuxQuestions,

It's only urgent to you, not to us. We're all here in our free time helping out others. ASAP and urgent is considered pretty rude on LQ. That being said, have a look at
Code:
man usermod
Kind regards,

Eric
 
Old 02-25-2011, 01:59 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this is not """urgent"""" for anyone here, please do not demand ""urgent" attention, especially if you are going to provide so little useful information. What kind of remote login are you even talking about?
 
Old 02-25-2011, 03:49 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,763

Rep: Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764
Lock user

usermod -L user
where 'user' is the account name to lock.

This will prevent anything that depends upon PAM to allow a logon. If you have ssh configured NOT to use PAM, I am not sure if that would bypass this.

You REALLY DO need to supply enough information the first time if you want an adequate answer the first time. I hope we have helped.
 
Old 02-25-2011, 04:04 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by wpeckham View Post
usermod -L user
where 'user' is the account name to lock.

This will prevent anything that depends upon PAM to allow a logon. If you have ssh configured NOT to use PAM, I am not sure if that would bypass this.

You REALLY DO need to supply enough information the first time if you want an adequate answer the first time. I hope we have helped.
But this will affect the password string in shadow, so will affect *ALL* password authenticated logins, not just "remote" ones, whatever that means.
 
Old 02-25-2011, 04:28 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
//Thread title changed to a more appropriate one.
 
Old 03-03-2011, 10:04 AM   #7
cehgopal
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
My requirement is to disable the remote login for application ids so that, the id should be only login as application environment and su - appid.
Advance thanks
Gopal
 
Old 03-03-2011, 01:48 PM   #8
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

You can diable by changing the /etc/passwd file for the user from
Quote:
user::500:500::/home/user:/bin/bash
Quote:
user::500:500::/home/user:/bin/false
helpinlinux.com

Last edited by siranjeevi; 03-03-2011 at 01:49 PM. Reason: I didnt update detaily
 
Old 03-03-2011, 02:00 PM   #9
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Quote:
Originally Posted by siranjeevi View Post
Hi,

You can diable by changing the /etc/passwd file for the user from



helpinlinux.com
You can also change that file from
Code:
user::500:500::/home/user:/bin/bash
to

Code:
user::500:500::/home/user:/bin/nologin
 
Old 03-03-2011, 02:08 PM   #10
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
When an su should be allowed, changing /etc/passwd doesn't lead to the intended setup AFAICS. I would suggest to put DenyUsers foobar in /etc/ssh/sshd_config and restart sshd.
 
Old 03-05-2011, 02:01 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by Reuti View Post
When an su should be allowed, changing /etc/passwd doesn't lead to the intended setup AFAICS. I would suggest to put DenyUsers foobar in /etc/ssh/sshd_config and restart sshd.
Well this doesn't answer the question either, does it? They asked about remote logins, not ssh remote logins. As such, I personally prefer using /etc/security/access.conf to allow multiple services to be configured at a single point for user access.
 
Old 03-07-2011, 04:38 AM   #12
ravikiran189
Member
 
Registered: Mar 2011
Posts: 45

Rep: Reputation: 4
hope this helps you to some extent

http://www.samlesher.com/ubuntu/ubun...e-command-line
 
  


Reply



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
Disable certain user login via XDMCP kofucii Linux - Newbie 0 08-17-2009 02:13 AM
Want to Disable remote root login over network maxy7710 Linux - Newbie 3 11-11-2008 12:33 AM
how to disable *any* remote login? lmmix Linux - Security 3 03-07-2005 04:51 AM
Disable remote login shutdown/reboot student04 Linux - Security 1 03-06-2005 08:29 PM
disable user login ust Linux - General 2 04-01-2004 12:06 PM

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

All times are GMT -5. The time now is 01:07 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