Solved

Block password authetication on specific  user on Linux

Posted on 2013-05-17
3
593 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39175602
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
ID: 39175815
Can you send me an example ?
0
 
LVL 30

Accepted Solution

by:
serialband earned 500 total points
ID: 39176279
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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

630 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