LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-21-2007, 03:08 PM   #1
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Rep: Reputation: 15
Advice needed: Need to set up SCP for remote users


I generally use hosts.allow to lock-down services and IPs that can access my machines, all of which sit inside of a firewall and can only be accessed via LAN, WAN, or VPN. That said, I have to set up a machine which will be exposed to the outside which will allow a Windows application to drop a datafile off.

My plan is to set a rule on the firewall to only allow SSH traffic to this machine. The app will have a username/password that it passes and all the files will be dropped off, via SCP, in one /home directory. This still leaves me open to brute force attacks etc. I will not know the IPs of valid users, they will be connecting through their ISPs.

I could use some ideas on hardening this approach. Thanks.
 
Old 08-21-2007, 03:19 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
1) use ssh preshared keys and disbled text passwords so brute force attacks are irrelevant

2) use fail2ban to analyze connection logs and ban IP's apparently trying to brute force in the first place.
 
Old 08-21-2007, 03:24 PM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
If possible, only authenticate via public key encryption. I.e. don't allow passwords. The downside of that is if your users get careless with their private keys, anybody with possessing that key can log in. You might be able to tighten that down by only allowing logins via these keys to execute a particular command (a feature available with public key logins). If your remote user will be executing an scp command, I believe the local command is also scp, possibly with parameters. I am not sure of details, but I think it can be done. And, of course, you want the account they are logging into to have no more access than necessary.
 
Old 08-23-2007, 01:46 PM   #4
j_70
LQ Newbie
 
Registered: Aug 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks for the input; a few questions:

1. Is it possible to have Public key authentication for a single user, rather than the whole server.

2. What is a good strategy for locking down a user to write only to a single directory?

Thanks, this has been very instructive.
 
Old 08-23-2007, 02:52 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
1. yes absolutely. both server wide and user specific keys of the account being logged into are checked as standard so if a known user has their matching key in /home/userA/.ssh/authorized_keys then that account only will permit access.

2. well a normal user account in a proper system will largely be in that state by default, except for /tmp. you could always place them in a chroot jail so the rest of the file system is inaccessible...
 
  


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
cronjob --> my script to scp to remote server bskrakes Linux - General 5 07-04-2007 04:25 PM
How can I show the users connected to SCP server? xconspirisist Linux - Software 2 03-05-2007 11:17 PM
scp/ssh tail(multiple file) remote copy tpreitano Linux - General 1 08-22-2005 02:17 PM
Using SCP with two different users BluePyre Linux - Software 2 09-07-2004 03:12 PM
scp :copy file from one remote comp to another aniketh Linux - Networking 4 06-16-2004 02:31 AM

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

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