Advice needed: Need to set up SCP for remote users
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
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.
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.
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.
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.