SSH

Taking care of your Linux box.
Post Reply
venky145
Havaldaar
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
Location: qatar
Contact:

SSH

Post by venky145 »

hi

I want allow SSH for a particular MAC address only.

how to do this in iptables
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

i think this will work, but i can't test it right now:

Code: Select all

ptables -A INPUT -m mac --mac-source 00:aa:22:33:44:ff -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear lambda,
Salam,
lambda wrote:i think this will work, but i can't test it right now:

Code: Select all

ptables -A INPUT -m mac --mac-source 00:aa:22:33:44:ff -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP
This will work.

Best Regards.
Farrukh Ahmed
x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Post by x2oxen »

This will work but only in case of layer 2 network if any of layer 3 device came into play you won't be able to login even from that allowed mac address.
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com
Post Reply