Solved

Setup Putty SSH

Posted on 2012-12-20
3
633 Views
Last Modified: 2013-01-02
1. How to configure the Centos such that it always need to check for the private key for user access without inputing any password directly ?

2. How to configure the Centos such that it always need to check for the private key + password before accessing the Centos ?

Thanks
0
Comment
Question by:AXISHK
3 Comments
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 38712220
1) in /etc/ssh/sshd_config:

PasswordAuthentication no
PubkeyAuthentication yes

will allow access only via key pair, not via password.

This is configurable on a per-user basis, by means of the "Match" directive.

2) Forcing checks of both Unix password and key pair is not possible.
A valid key (optionally including a passphrase, see below) is always considered sufficient to log in, an additional prompt for the Unix password is not provided.

You can add a passphrase to the key during key generation, so additionally to the key verification a passphrase prompt will take place, but this passphrase is part of the key and has nothing to do with Unix passwords.

In any case you're required to specify your private key in the local (Windows) PuTTY configuration (see below) and your public key in the ~/.ssh/authorized_keys file of the target user on CentOS.

Attention: Putty cannot directly open OpenSSH keys. If you created your key with ssh-keygen on CentOS you'll need to convert id_rsa to id_rsa.ppk using a program called puttygen.exe.
Specify the converted key in PuTTY under "Connection -> SSH -> Auth -> Private key file ...".
When saving the respective session this path will be saved as well.
0
 
LVL 77

Accepted Solution

by:
arnold earned 250 total points
ID: 38712234
You would need to edit sshd_config and make sure to enable publickey while disabling password authentication.

What exactly are you looking todo.

Usually if both password and publickey based authentication is enable item 1 is the default behavior, the equivalent second option is part of the public key authentication dealing with you setting a passphrase n the key.
The number 2 you seem to want a two factor authentication.
Privatekey/server account password are on the same level I.e. one or the other, not sure there is a way to sequence them.
http://kiteplans.info/2012/04/06/two-factor-ssh-virtualmin-authentication-google-authenticator/
There are other options using rsa keyfab, github, etc.
0
 

Author Closing Comment

by:AXISHK
ID: 38738568
tks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
Secure Shell (SSH) is a network protocol for secure data communication, mainly used to administer remote Unix / Linux servers via command line. But it also allows the user to open a secure tunnel between a client and a server where he can send any k…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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…

911 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

19 Experts available now in Live!

Get 1:1 Help Now