LinuxQuestions.org
Visit Jeremy's Blog.
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 03-28-2005, 04:07 PM   #136
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33

ssh-keygen -t rsa

then look in your /etc/ssh/sshd_config and see -
HostKey /etc/ssh/ssh_host_rsa_key, uncomment that line if it's not all ready.

RSAAuthentication
PubkeyAuthentication
AuthorizedKeysFile

than add-
AllowUsers
for whom should be allowed in.
 
Old 03-28-2005, 10:58 PM   #137
dsschanze
Member
 
Registered: Aug 2004
Location: Gainesville, FL
Distribution: Linux Mint 12, Win7, iOS
Posts: 208

Rep: Reputation: 33
I have been getting these types of things for like three months. I really hate people like that that don't have anything better to do but go around and muck with other peoples' data!
 
Old 03-29-2005, 12:46 AM   #138
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
thank you man, I had trouble with this so far because no article was exacty about this matter and especially my problem was with sshd_config because I don't have 2 machines all the time to test only when I'm in my office I have it as a client machine to test my home server and as you can imagine if I mess up the conf I don't have connection )
 
Old 03-29-2005, 12:48 AM   #139
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
btw: when u have let's say one user in allowed users do we need deny used line in sshd_config although it works for me but I can't understand from the log exactly if it's denied by this criteria or because no such user at all
 
Old 03-29-2005, 02:31 PM   #140
virus1824
LQ Newbie
 
Registered: Mar 2005
Posts: 4

Rep: Reputation: 0
I also had these attempts almost everyday with my sshd server.
Is tracking the ip's and e-mailing the ISP worth doing, or just a waste of time?
 
Old 03-29-2005, 04:18 PM   #141
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
Quote:
Originally posted by johnnydangerous
btw: when u have let's say one user in allowed users do we need deny used line in sshd_config although it works for me but I can't understand from the log exactly if it's denied by this criteria or because no such user at all
i would have to see the line that you mean.

this is a spot of mine. you can tell what it means.
Mar 27 11:53:25 xxxxx sshd[21772]: User root not allowed because not listed in AllowUsers
 
Old 03-30-2005, 12:19 AM   #142
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
Mar 25 05:38:34 fbi sshd[20078]: Failed password for invalid user test from 211.
176.33.46 port 59510 ssh2
Mar 25 05:38:39 fbi sshd[20083]: Failed password for invalid user guest from 211
.176.33.46 port 59666 ssh2
Mar 25 05:38:45 fbi sshd[20088]: Failed password for invalid user admin from 211
.176.33.46 port 59807 ssh2
Mar 25 05:38:50 fbi sshd[20093]: Failed password for invalid user admin from 211
.176.33.46 port 59948 ssh2

well they are in sshd_config:

AllowUsers XXXXXX
DenyGroups root bin daemon sys adm tty disk lp mem kmem wheel floppy mail news uucp man games slocate utmp smmsp mysql rpc sshd shadow ftp nogroup console xcdwrite
DenyUsers root bin daemon adm lp sync shutdown halt mail news uucp operator games ftp smmsp mysql rpc sshd nobody test guest user admin apache www wwwrun httpd irc www-data www pamela cosmin noc patrick horde iceuser rolo data matt jane deniro

but it's not looking like yours what am I doing wrong?
 
Old 03-30-2005, 02:03 AM   #143
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
Quote:
Originally posted by emetib
ssh-keygen -t rsa

then look in your /etc/ssh/sshd_config and see -
HostKey /etc/ssh/ssh_host_rsa_key, uncomment that line if it's not all ready.

RSAAuthentication
PubkeyAuthentication
AuthorizedKeysFile

than add-
AllowUsers
for whom should be allowed in.
so I have the keys in my /~/.ssh/id_rsa and .pub I imported the id_rsa in my client, and when I try key authentication method it's falling back to password auth method

I couldn't find on server log why it's not accepted

maybe it's from AuthorizedKeysFile or HostKey /etc/ssh/ssh_host_rsa_key section?
also I'm trying to allow only key auth method so it should not accept the fallback to password method?
any help will be very appreciated, thanks in advance!
 
Old 03-30-2005, 09:10 PM   #144
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
get rid of the denyusers, denygroups.

look in your sshd_config and see what your keys are supposed to look like and where they are supposed to belong. it's in there, you just have to look.
 
Old 03-30-2005, 11:22 PM   #145
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
well I have key as I said in my ~/.ssh (generated with sshkeygen according to user in use)
but also in /etc/ssh/ <- the file specified by Hostkey=
there should be some automatic pointing to the key according to the user attempting to log on.
my main concern is how to enable ONLY RSA based autyhentication?

my sshd_config could be posted but what you suggested is in there in shape

:

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
#ServerKeyBits 768

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
#MaxAuthTries 6


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 yes
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes

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

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

# Kerberos options
KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

UsePAM=yes

what is wrong here? pls help me out some
 
Old 03-31-2005, 04:27 PM   #146
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
run the keygen again. when it asks for you to type in a passwd, just hit enter twice. once that is done, then you have to put your id_pub, the the sever that you want to connect to, in the ~/.ssh/authorized_keys file.

then if things go right, when you type ssh whateverserver you should log right in. i have a problem with a friends that doesn't allow me to, and i've asked and asked to see the file, yet he won't let me. won't even give me the answer to my question so i can make it work. so if it doesn't work for you, i don't know what might be broke to fix it, since mine works fine, and your file looks fine to me.
 
Old 03-31-2005, 04:51 PM   #147
Gibsonist
Member
 
Registered: Mar 2004
Location: Meersburg (GER)
Distribution: Cygwin,RH 7.2 7.3, SuSe 6.4 8.2 9.1,TinyLinux, Debian Sarge, Knoppix 3.*, Knoppicilin, Knoppix STD
Posts: 191

Rep: Reputation: 30
Quote:
Originally posted by johnnydangerous

UsePAM=yes

Change it to UseAPM=no

leaving this on yes allows you to still access the server without key
(least had that problem on my system but could be down to some annomalies between ssh2 and openssh)

I believe I do not need to point out how to run ssh-agent and ssh-add,
 
Old 04-01-2005, 12:26 AM   #148
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
well if you may pls tell about ssh-agent and ssh-add
 
Old 04-01-2005, 12:27 AM   #149
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
if some one has a good security set sshd_config pls post it here
 
Old 04-02-2005, 04:03 PM   #150
bfoddy
LQ Newbie
 
Registered: Apr 2005
Posts: 18

Rep: Reputation: 0
This has bothered me for years. What I'd like to see is a setup something like this:
1. My main account - no password accepted, key required
2. A dedicated external account - password accepted but would be a very long / hard to
guess password.

That way inside my firewall, my simplier passwords are ok. But from the outside
I have to go through a few extra steps and lengthly passwords to get in. Short of
running 2 sshd daemons, I can't figure out how to accomplish this.
 
  


Reply

Tags
hostsdeny, keys, ssh


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...log files that store the login attempts Bgrad Linux - Networking 4 03-29-2010 09:40 AM
Failed SSH login attempts Capt_Caveman Linux - Security 38 01-03-2006 03:22 PM
ssh login attempts from localhost?! sovietpower Linux - Security 2 05-29-2005 01:19 AM
SSH login attempts - how to get rid of the automated malware? alexberk Linux - Security 1 05-24-2005 04:57 AM
How do I block IP's to prevent unauthorized SSH login attempts? leofoxx Linux - Security 6 05-23-2005 09:36 PM

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

All times are GMT -5. The time now is 05:02 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