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.
I found out that a user who has an account on my network was running a ftp server from his home directory.
I was having VERY HIGH uploads and there was no room for downloads.
How can i stop this from happening again?
restrict bg processes ? filter traffic to your shell boxes to only allow incomming ssh traffic on port 22 (or whatever port you use) ? shoot the user in question ?
The filters will not help me very much. If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters...
and quotas are not a solution because the binarys of the ftp server were under 1MB...
how i can restrict the background processes?
Run a daemon for that. Search Freshmeat.net
The filters will not help me very much.
What phoeniXflame means is you should block anyone from trying to set up a connection with any port except TCP/22. Incoming requests for a TCP connection have the SYN flag set, so that should be easy using a restrictive default policy of "DROP" and only allowing SYN's and related traffic for TCP/22.
If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters.
Patch your server with the kernel patches from grsecurity.net, then you can deny any user setting up server and/or client sockets.
and quotas are not a solution because the binarys of the ftp server were under 1MB.
Using user quota's should work, it doesn't look for transfer size but used diskspace and files.
what i meant with quota was that the guy was copying files from my server and not save them here. We have a large amount of movies here, so i believ he was copying movies. So, because of his uploads we run out of bindwith.
move the movies to an other location and lock the user at one directory. And if you donīt need the ftp service, take it down and only alloy ssh. Also, why a normal user does have the privileges to start services and stuff??
Also, why a normal user does have the privileges to start services and stuff??
i relly don't know. I am new on the administration of a linux server. He only had access to a normal ftp account. He WAS locket on the home directory. This is why he started a new ftp server.
Is there a way to stop users from having access to start programs?
where i worked he had hubs before we went to switches and uploads
(kazaa, morpheous...etc) killed the network connections in certain
buildings so we just physically unplugged a user until we could contact
em and tell em to stop or else their connection would not be restored.
Originally posted by cristi1979 The filters will not help me very much. If he knows how to start a ftp server in the background on a high port on my server, i think he knows how to bypass my filters...
a monkey with half a brain could start an ftp server on a high port in the background, if this particular box is only used for shell access for customers etc. etc. then all you have to do is drop all incomming connections APART from those which are aimed at port 22 and which are either NEW or RELATED,ESTABLISHED that way even if he does manage to run a server, no-one else will be able to connect to it, heres a little script that would do it ....
Code:
IPTABLES=/usr/sbin/iptables
# Flush tables and setup default rules
$IPTABLES -F
$IPTABLES --delete-chain
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP
# INPUT
# Accept established connections
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow incomming SSH connections
$IPTABLES -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
# Log and drop everything else
$IPTABLES -A INPUT -j LOG --log-prefix "Incomming packet dropped: "
$IPTABLES -A INPUT -j DROP
# OUTPUT
# Accept established connections
$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Log and drop everything else
$IPTABLES -A OUTPUT -j LOG --log-prefix "Outgoing packet dropped: "
$IPTABLES -A OUTPUT -j DROP
that should do it, if you need to allow any other incomming connections (if you run an httpd or something) just add a rule similar to the SSH one detailed above, hope that helped
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.