LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-25-2003, 01:06 AM   #1
m15a4
Member
 
Registered: Sep 2003
Distribution: SuSE 10
Posts: 55

Rep: Reputation: 15
Allow SSH from specific IP's ONLY.


Where can I specify the IP of the PC that will be logging in via ssh?
 
Old 12-25-2003, 01:29 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Edit /etc/hosts.allow
sshd: 1.2.3.4

You should also block all inbound traffic to port 22 with iptables, and make a special allow rule just for the IP (src 1.2.3.4) you want to allow. Of course, replace 1.2.3.4 with your actual IP.
 
Old 12-29-2003, 03:43 AM   #3
fr0zen
Member
 
Registered: Nov 2003
Location: 127.0.0.1
Distribution: xubuntu
Posts: 217

Rep: Reputation: 30
What if your IP is semi-dynamic? That is, mine changes every 3 weeks or so. Sometimes every week, or month. Kind of random. Though, the changes only involve the last 2 octets.

Anyway to restrict it based on hostname?
 
Old 12-29-2003, 04:02 AM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
You can use tcpwrappers to restrict based on partial IPs, like :
SSHD: 123.456.

It can also restrict by hostname as well. So if you got a completely differnt IP you could still use:

SSHD: .jibib-east.aol.com or just .aol.com
 
  


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 won't connect from outside IP's surfduke Mandriva 8 12-28-2004 10:36 PM
stopping specific ip's from accessing apache lawadm1 Linux - Software 7 09-26-2004 02:40 PM
How to lock out ip's that try to ssh by force mazzo Linux - Security 3 08-19-2004 02:28 PM
Need program to find specific IP's from a list cjdock Programming 20 12-17-2003 09:08 AM
Allow only specific IP's to log to FTP server ganninu Linux - Security 5 12-11-2003 07:26 AM

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

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