APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > FAQ > How can I restrict who can login with ssh?
Printer Friendly Version




SCO Unix ® FAQ section

TCP/IP and NFS FAQ



This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

How can I restrict who can login with ssh?

We often have systems that have run for years with no connection to the outside world, and now suddenly an Internet connection is added and ssh access is set up. Unfortunately, many users have weak or even blank passwords.

If only some users need to use ssh, it's best to set up new users with strong passwords and restrict ssh to only those users.

You do this by adding a line like this to /etc/ssh/sshd_config


 AllowUsers      doug essex 
 

Restart sshd after making this change (you can even do that if you are currently logged in over ssh). Only those users will be allowd ssh access.



Dave DiPietro noted: SCO versions may put the sshd configuration file at /usr/local/etc/sshd_config.

If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

6 comments



Click here to add your comments








Fri Sep 26 09:30:53 2008:   JW


Just what I needed and works great, thanks!



Sun Mar 8 22:22:12 2009:   anonymous

gravatar
Can I put the list of valid users into an external file, then have sshd_config source that file?




Sun Mar 8 23:33:22 2009:   TonyLawrence

gravatar
I'm not aware of any version that has inclusion features - it certainly would be a good idea. ALL config files should do that..



Tue Jul 7 07:57:34 2009:   anonymous

gravatar
Really Gud But I have one doubt about this.
Can we add this parameter to any where in to this file /etc/ssh/sshd_config or
do we have any specific line to add this entry.
Please let us know.



Tue Jul 7 10:24:51 2009:   TonyLawrence

gravatar
You can put the line anywhere. Usually you'd put it down with other login related lines just for neatness.



Sun Jun 27 12:28:26 2010:   anonymous
http://www.FastJournaledDialog.nl
gravatar
For production systems, remove every user. Maintenance should be done by dialogs. This reduces human error. Ofcourse the dialogs must be developed on a test system. We made segregation of duty work and all without shell access. If systems fail you can finally, start a shell via a dialog or log on with root on the console.
There must be more tools, but we used FJD (FastJournaledDialog.nl).

Greetings Freddy


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide




 I sell and support
 Kerio Mail server
g_face.jpg

This post tagged:

       - FAQ
       - Networking
       - SSH
       - Security




Unix/Linux Consultants

Skills Tests

Guest Post Here