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! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
06-17-2008, 07:36 PM
|
#1
|
Member
Registered: Jan 2006
Distribution: debian
Posts: 63
Rep:
|
my hosts.allow hosts.deny not working
I am under attack by persistent login attempts to my dropbear sshd.
I modified hosts.allow to be my ip address
hosts.deny to be all: all
Then I tried to connect to ssh using a different ip, and I was able to login. And my /var/log/auth.log just keeps on growing with hacking attempts.
-------
My favorite websites:
Buy and sell class notes, old exams, papers, lab reports, admission essays.
Ask and answer Linux questions.
Read free books without walking to the library.
Last edited by twlilinux; 08-15-2008 at 03:38 PM.
|
|
|
06-17-2008, 09:10 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
This only works if a daemon is compiled with tcp wrappers. e.g.:
Code:
$ ldd /usr/sbin/sshd | grep 'libwrap'
libwrap.so.0 => /usr/lib/libwrap.so.0 (0x0067e000)
Instead, consider using iptables rules to protect your dropbear service.
|
|
|
06-17-2008, 09:12 PM
|
#3
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
Another option is to use the AllowUsers directive with the form user@host. (Does dropbear support that?)
I don't mean to lecture, but you shouldn't be running services that listen to connections from the 'net if you're not sure how to properly secure them. Is turning off dropbear altogether an option?
|
|
|
06-17-2008, 09:49 PM
|
#4
|
Member
Registered: Apr 2008
Posts: 310
Rep:
|
Hey there,
It's primitive but you can also just test from the command line by running tcpd with sshd as its argument. That'll quickly tell you if you have it compiled correctly or not.
Also, how specific is your hosts.allow? Is it ALL for your IP address or is it split up by service? If it's ALL, your sshd probably doesn't support tcp wrappers. If you're splitting by service, there might be an issue in the file.
Another thing you can try is to use lsof (or a similar program) to determine where sshd is running from. It's a long-shot, but if you have more than one sshd on your system it could be that the wrong one is being protected.
No offense meant, just trying to cover all the angles I can see from scanning over the post.
Best wishes,
Mike
|
|
|
06-17-2008, 10:39 PM
|
#5
|
Member
Registered: Jan 2006
Distribution: debian
Posts: 63
Original Poster
Rep:
|
alright, ty for your suggestions. Unfortunately, my server is only accessible remotely, and more unfortunately, I'm the only linux admin that I can afford.
I suspect that dropbear may not support tcp wrappers. But I'm not certain. Anyway, I installed openssh and made it listen to a strange port number. Hopefully, that will keep the hackers guessing until tomorrow. I'll try to figure out firewalls and tcp wrappers ... or die(mysql_pun_intended) trying.
-------
My favorite websites:
Buy and sell class notes, old exams, papers, lab reports, admission essays.
Ask and answer Linux questions.
Read free books without walking to the library.
Last edited by twlilinux; 08-15-2008 at 03:38 PM.
|
|
|
06-17-2008, 11:15 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Is this an embedded Linux system? If not, I don't see any reason not to use openssl instead.
There are some things you can do to secure ssl further. - disable root logins
- disable password authentication
- use public key authentication
- change the port number
- use "AllowUsers" (which disables all other users & groups)
- Create your key with a good passphrase
- Use a "from=" field in authorized_keys.
A passphrase will help protect your private key. A "from=" option in the server's authorized_keys file will prevent logging in from another location even it the private key is lost.
|
|
|
06-19-2008, 01:42 AM
|
#7
|
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687
Rep:
|
Have you looked into the links I gave you here?
http://www.linuxquestions.org/questi...0/#post3188110
I did not realize that dropbear does not have a config-file - the options are given when it is started (like on the command-line) - usually it is started from /etc/init.d/...
will tell you more.
You could surely install openssh and replace dropbear by it - but most of it should work just as well.
Was all that not working or not enough? Or just problems configuring dropbear.
Portknocking is another step to make it more difficult for someone to attack or DOS you.
Last edited by jomen; 06-19-2008 at 01:44 AM.
|
|
|
06-19-2008, 07:20 AM
|
#8
|
Member
Registered: Jan 2006
Distribution: debian
Posts: 63
Original Poster
Rep:
|
Thanks alot guys, this really helped. I'm no longer getting any spam login attempts. What's more, after I secured sshd, my shell command seemed to work faster too (before this, it took a fraction of a second for anything I type to get through to the terminal. Now it's instantaneous). Cheers!
-------
My favorite websites:
Buy and sell class notes, old exams, papers, lab reports, admission essays.
Ask and answer Linux questions.
Read free books without walking to the library.
Last edited by twlilinux; 08-15-2008 at 03:39 PM.
|
|
|
All times are GMT -5. The time now is 08:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|