Configuring SSH to accept only keys (already have keys)
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Configuring SSH to accept only keys (already have keys)
Hi,
I'm a bit new to securing SSH to do this so I appologise if I may not seam so godly to you guys..
I have a system, Redhat 9 that has openssh installed OpenSSH-3.5p-6 including servers and clients..
I am looking to only enable SSH access via keys. Everyone who will be SSH'ng into this box will already have a public/private keypair and will want to use these.. How can I configure SSH to accept these and not password access?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
First off, UPGRADE YOUR SSH!!! there was a notification on the home page of LinuxQuestions.org for weeks urging everyone to upgrade to 3.7.1p2 because of security flaws in OpenSSH. Go do that IMMEDIATELY.
Next, edit the following lines in /etc/ssh/sshd_config and restart your ssh daemon
PubkeyAuthentication yes
PasswordAuthentication no
If you want only Pubkey and nothing else, you can search through the whole file and turn off any other type of auth. Just make sure you have Protocol 2 because if you turn off RSAAuthentication you will need to use DSA (ssh2-only).
First off, UPGRADE YOUR SSH!!! there was a notification on the home page of LinuxQuestions.org for weeks urging everyone to upgrade to 3.7.1p2 because of security flaws in OpenSSH. Go do that IMMEDIATELY.
You do not neccessarly need to upgrade to 3.7.1p2 since most distribution backport patches to their stable branch so the changes are minimal. Just do the normal way for updating your software. For Debian this would be apt-get update && apt-get upgrade.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.