LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-14-2004, 06:14 PM   #1
aleet2600
LQ Newbie
 
Registered: Apr 2004
Posts: 19

Rep: Reputation: 0
Newbie: ssh without public key still works?


I installed openSSH and using PuTTY on a Win2k machine.

I didn't setup any public key on the Linux for my user account. There is no ~/.ssh directory at all. But I can still login remotely. How come?

login as: user1
Server refused our key
Password:
Last login: Wed Apr 14 18:07:32 2004 from 1.2.3.4
Have a lot of fun...
user1@linux:~>
 
Old 04-14-2004, 07:50 PM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
You are looking for YOUR keys in your home directory. These are the keys generated and employed for your use in connecting to an ssh server. The pub/private pair that the machine owns, and uses to facilitate and maintain incoming connections reside in /etc/ssh or /etc/sshd.
 
Old 04-15-2004, 10:40 AM   #3
aleet2600
LQ Newbie
 
Registered: Apr 2004
Posts: 19

Original Poster
Rep: Reputation: 0
I am sorry I didn't phase the question properly. My question is, how come I can still login to Linux using PuTTY on port 22 without a correct public key copied to my Linux account?

Here is what I have done:
1. Linux SuSE 9.0 with openSSH installed.
2. WinNT with PuTTY and SSH enabled.
3. Generate public and private key on PuTTY.
4. *** Did not copy the public key to Linux ***
5. Use PuTTY connect to Linux port 22.
6. Somehow I can still login.

Why did it work? Is my login name and passwd transmitted in SSH? Is my session still inside SSH after I logged in?
 
Old 04-15-2004, 10:47 AM   #4
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Re: Newbie: ssh without public key still works?

Quote:
Originally posted by aleet2600
login as: user1
Server refused our key
Password:
Last login: Wed Apr 14 18:07:32 2004 from 1.2.3.4
Have a lot of fun...
user1@linux:~>
You tried to send your private key but the server refused it bc it didnt have any public key for user1. So it asked for your linux password and u entered it -> u were successfully logged in.
 
Old 04-15-2004, 11:03 AM   #5
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
You will have to configure your sshd to not accept password logins, else it will try password if the keys are missing/wrong.
 
Old 04-15-2004, 03:10 PM   #6
aleet2600
LQ Newbie
 
Registered: Apr 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for the explainations.

I attach my sshd_config here. As you can see, I already set "PasswordAuthentication no" Doesn't that turn off password auth?


# This is the sshd server system-wide configuration file. See
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCreds yes

# Set this to 'yes' to enable PAM authentication (via challenge-response)
# and session processing. Depending on your PAM configuration, this may
# bypass the setting of 'PasswordAuthentication'
UsePAM yes

#KeepAlive yes
#UseLogin no
UsePrivilegeSeparation no
#PermitUserEnvironment no
Compression yes

Subsystem sftp /usr/lib/ssh/sftp-server
 
  


Reply



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 public key authentication teacup Linux - Networking 4 11-27-2011 11:27 PM
DISCUSSION: Public key authentication with ssh david_ross LinuxAnswers Discussion 31 02-02-2011 08:13 AM
ssh public key authentication problem flgal3 Linux - Software 21 02-06-2009 11:15 AM
SSH - Problem with Public Key Authentication HaPagan Linux - Security 5 11-28-2005 11:27 PM
ssh using public key jkmartha Linux - Networking 1 05-04-2005 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:55 AM.

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