Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-01-2012, 05:33 AM   #1
Senior Member
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
ssh keys only login

I have read and found how to allow users to only ssh with keys, not permit password login. Many users create weak passwords, so I want to force users of my server to login with keys. ssh brute force is very common. However, I'd like to be able to login with a secure password I use for my user from anywhere that I may not have access to my ssh public key. Is there a way I can prevent all users but my user to login through using a password and the rest, keys only?
Old 12-01-2012, 07:59 AM   #2
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
It can be done using passphrase mechanism & then ask your users to once generate a passphrase for login, instead of a simple password. It can be done by generating ssh keys for the users whom you want to give access with a stong password. On the other hand, for youeself do not use such ssh key, but only password.
Old 12-01-2012, 07:59 AM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Try adding this to the bottom of your sshd_config file and restart the sshd daemon.

Match User yourusername
PasswordAuthentication yes

I don't know if it will override a global "ChallengeResponse No" setting however.
The options you can use in a match clause are listed in the man 5 sshd_config man page.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ssh login using keys bittus Linux - Newbie 5 11-30-2007 07:55 AM
Using SSH keys with different login name - is it possible? Micro420 Linux - Networking 5 02-04-2007 03:34 PM
Can't login with ssh pub keys fisayo Mandriva 2 11-17-2005 08:12 PM
SSH Login - Forcing keys! jackster Linux - Security 5 01-25-2005 09:09 AM
Can't login using ssh keys linuxboy69 Linux - Software 2 03-19-2004 03:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration