LinuxQuestions.org
Review your favorite Linux distribution.
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-16-2009, 12:41 AM   #1
slide77
LQ Newbie
 
Registered: Jun 2007
Posts: 22

Rep: Reputation: 16
can I limit ssh and apache connections to one mac address?


I'm using Slackware 12 on my desktop. I like being able to ssh into the desktop from my iPhone when I'm away. Can I limit ssh access to my mac address for a little extra security?

SSH is no biggie, but what I'd really like to do is put some files on apache so I can access them from my phone. Can I also limit that to my mac address?

I've read up on apache authentication a little, but I didn't have much success so far and I wonder if iptables would be a better place to do it?

I know a mac address can be spoofed but no one knows my mac address or the fact that I have a server and the files aren't that important, I just don't want them in the open.
 
Old 04-16-2009, 12:54 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by slide77 View Post
I'm using Slackware 12 on my desktop. I like being able to ssh into the desktop from my iPhone when I'm away. Can I limit ssh access to my mac address for a little extra security?

SSH is no biggie, but what I'd really like to do is put some files on apache so I can access them from my phone. Can I also limit that to my mac address?

I've read up on apache authentication a little, but I didn't have much success so far and I wonder if iptables would be a better place to do it?

I know a mac address can be spoofed but no one knows my mac address or the fact that I have a server and the files aren't that important, I just don't want them in the open.
MAC addresses are implemented in the data link layer. Therefore, packets on the Internet don't make use of them. The MAC address your server will see when you connect from your iPhone via the Internet will be the MAC address of the node on your LAN which encapsulated the IP packet in a frame. Typically, this would be the MAC address of the LAN interface on your router. So the answer to your question is no (unless you weren't refering to access from outside the LAN).

Last edited by win32sux; 04-16-2009 at 01:06 AM. Reason: Added some Wikipedia links.
 
Old 04-18-2009, 11:09 AM   #3
lindylex
Member
 
Registered: Mar 2007
Posts: 192

Rep: Reputation: 17
Try this slide77. In your sshd_config file AllowUsers directive set that to only you and PermitRootLogin to no. Generate a ssh key on you Iphone and place it on the server. If you are trying to gain access to files remotely the better way to do this is with scp and other tools that I am unsure if your Iphone supports.

This is list o various ways I can push and pull content.

Pull
rsync -r -v --progress -e ssh root@remote-server:/original/path /destination/path/
scp foobar@hostB:~/myfile.txt /local/destination/path/
Copy a folder from one host to another by adding option -r
scp -r foobar@hostB:/remote/folder

Copy from one host to another with different ssh account.
scp foobar@hostB:~/myfile.txt root@hostF:~/

ssh target_address cat remotefile > localfile

Push
scp myfile.txt foobar@hostB:/remote/send/to/path
ssh target_address cat <localfile ">" remotefile

tar -czf - /some/file | ssh root@192.168.2.100 tar -zxvf - -C /destination

scp -c blowfish -C Windows_LAMP_and_ASP_install_files.folder.tar root@192.168.2.10:/home/
scp -c blowfish Windows_LAMP_and_ASP_install_files.folder.tar root@192.168.2.10:/home/
scp Windows_LAMP_and_ASP_install_files.folder.tar root@192.168.2.10:/home/ #FASTEST
tar -czf - Windows_LAMP_and_ASP_install_files.folder.tar | ssh root@192.168.2.10 tar -zxvf - -C /home/

Push a directory on port 8008
scp -P 8008 -r /home/share root@192.168.2.4:/home/

rsync -e 'ssh -ax -c blowfish -p8008' -avz --progress /media/music/ root@192.168.2.9:/home/share/music/

rysnc with resume
rsync -r --partial --progress --ignore-existing --append --rsh=ssh my-local-folder-name user@destination-server:

Push and delete empty directories and extra files on the receiver.
rsync -r --partial --progress --ignore-existing --append --prune-empty-dirs --delete

Use this to test --dry-run and this to exclude certain files or directories --exclude='lost+found'

Last edited by lindylex; 04-18-2009 at 11:10 AM.
 
Old 04-19-2009, 04:11 PM   #4
slide77
LQ Newbie
 
Registered: Jun 2007
Posts: 22

Original Poster
Rep: Reputation: 16
Wow thanks for all that. I do have scp, that's what I've been using for simple one file copying but I'll play with these commands and probably put some to use.
 
  


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
how to reject connections which come from unknown mac address? Winanjaya Linux - Security 6 04-05-2009 09:40 AM
Limit number of concurrent connections in apache jakev383 Linux - Server 2 07-18-2008 03:58 PM
Limit connections to apache web server PlymWS Linux - Server 1 09-21-2007 01:19 PM
how to limit ssh connections to my isp only gruntwerk Linux - Networking 8 12-13-2006 02:05 AM
APACHE: limit max connections from the same IP ? tclwp Linux - Networking 3 06-24-2005 11:47 AM

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

All times are GMT -5. The time now is 10:44 PM.

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