Solved

Block password authetication on specific  user on Linux

Posted on 2013-05-17
3
581 Views
Last Modified: 2013-05-17
Hi,
I need to block password authentication for only specific users on Linux server, and leave key
option only. User can't be blocked to use password for other protocols like ftp

All changes should be done in sshd_config file
For UNIX I use following but it block all users on Linux

PasswordAuthDenyUsers user1 user2 user3
ChallRespAuthDenyUsers  [pam] user1 user2 user3

Thanks
0
Comment
Question by:IKeystone
3 Comments
 
LVL 26

Expert Comment

by:skullnobrains
Comment Utility
create a group for your user in sshd_conf and deny whatever types of authentication you need in that group
0
 

Author Comment

by:IKeystone
Comment Utility
Can you send me an example ?
0
 
LVL 27

Accepted Solution

by:
serialband earned 500 total points
Comment Utility
I believe the following should work on your linux system.

Create a group named keyonly and put your users in it.

Then add the following to /etc/ssh/sshd_config

Match Group keyonly
      PasswordAuthentication no
      ChallengeResponseAuthentication yes



You could also just match individual users.
Match User User_Name
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now