LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-10-2004, 02:58 AM   #1
fidelis
LQ Newbie
 
Registered: Sep 2004
Posts: 7

Rep: Reputation: 0
Post How to restrict the ssh operation for one user


Dear All,

I want to allow the ssh operation to only one user. currently i have restricted to the user 'root', the same i want to restrict for all the user except one authorised user. Kindly reply me back if there is anyway to achieve this?.


Thanks in advance.

Fidelis
 
Old 09-10-2004, 04:46 AM   #2
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Welcome to LQ.org, fidelis!

I do hope that you mean you have restricted sshd so that 'root' cannot log in. It is more secure to only allow non-privileged users to ssh, then su to root, if necessary.

At any rate, you can limit logins to specific user(s) by adding the AllowUsers keyword to your sshd_config file. If you had mentioned which distro you're using, I could probably tell you where to find this file (possibly /etc/ssh/sshd_config); although since you've already restricted logins, you should know where to find it.

The following is from the sshd_config man page:
Code:
     AllowUsers
             This keyword can be followed by a list of user name patterns,
             separated by spaces.  If specified, login is allowed only for
             user names that match one of the patterns.  `*' and `?' can be
             used as wildcards in the patterns.  Only user names are valid; a
             numerical user ID is not recognized.  By default, login is
             allowed for all users.  If the pattern takes the form USER@HOST
             then USER and HOST are separately checked, restricting logins to
             particular users from particular hosts.
Enjoy!
--- Cerbere
 
Old 09-13-2004, 02:37 AM   #3
fidelis
LQ Newbie
 
Registered: Sep 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Dear Cerbere,


Thanks alot for your help. It works fine.

Thanks,
Fidelis
 
  


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
restrict/allow ssh users mike30188 Linux - Security 2 06-20-2005 08:37 PM
restrict ssh logins by ip by user account Beans0063 Linux - Security 4 10-04-2004 01:29 PM
Restrict Directories to users with SSH aeruzcar Linux - General 5 09-11-2003 03:28 PM
How do I restrict ssh access to certain ip addresses? 360 Linux - Networking 5 04-05-2002 08:04 AM
What is the best way to restrict ssh access for RH7 360 Linux - Security 1 12-01-2001 06:28 PM

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

All times are GMT -5. The time now is 01:39 PM.

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