BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 1st, 2006, 04:19 AM
ais ais is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 34 ais User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 8 sec
Reputation Power: 8
FTP stops working after installing Apache port

I run Freebsd 5.4 on a remote server.

This is a brand new install. I enabled FTP and SSH by enabling inetd in rc.conf and uncommenting the ftp/ssh lines in inetd.conf and it worked fine.

I then installed CVSup and Portupgrade via Ports - everything was still fine.

Next I installed Apache2.2 (and its required packages) via ports. The installation went fine but I can no longer access the server via ftp although ssh still works.

I use WS_FTP on a windows box to access the remote server. A connection is made but the program then sits and waits for a response from the server which it apparently does not receive and the remote host terminates the connection.

Any ideas....?
__________________

: ----- >>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<< ----- :
: ---- You can't judge a man by his clothes ...or from his name ---- :
: ------ But you can tell a lot about him ...from his signature !!! ------ :
: ----- >>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<< ----- :

Reply With Quote
  #2  
Old April 1st, 2006, 10:03 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 44
Couple things you can try:

1. SSH in, and run tail -f /var/log/auth.log. While you are watching this log update, try your FTP connection and see what happens. You can also try looking at /var/log/messages the same way.

2. If this doesn't give you any good info, then right after the connection is terminated, run dmesg -a in your SSH terminal, and see if anything pops up.

3. Did you verify that inetd.conf has not been changed in some way? For example, is the FTP line still uncommented? Ditto for /etc/rc.conf

4. Have you considered just how really, really bad FTP is for security? Why not just use SFTP, which is enabled by default if you have sshd running. If you need a Windows client for this, try WinSCP. No more plaintext passwords sent through other people's routers . In fact, if you are running default, unprotected FTP on a server with a public domain name, it is only a matter of time before you are hacked.

5. If you really must have FTP, do it right. Disable inetd.conf, install ProFTPD (/usr/ports/ftp/proftpd), and learn how to configure /usr/local/etc/proftpd.conf so that only a limited number of users can get in, and learn how to set your other directives for maximum security. Pay special attention to MaxLoginAttempts and all the other "Max[something]" settings, as well as DefaultRoot. Turn RequireValidShell off and make sure that any user who is connecting to FTP is not able to connect via SSH (set them for /sbin/nologin). At least you can sleep with only one eye open at night .

Regards,

A FreeBSD user who has been hacked
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
  #3  
Old April 1st, 2006, 11:55 PM
ais ais is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 34 ais User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 8 sec
Reputation Power: 8
Thanks for the response.

I could not glean any useful info from the logs etc.

WS_FTP has an SFTP/SSH option which I tried, but it did not work, something to do with the keys missing I think.

In any case I downloaded SCP and that seems to work. SCP will be fine for server admin i.e. my use.

However, for uploading websites etc and in particular with Dreamweaver, what is the best approach - ProFTP?

FWIW I have now disabled FTP in inted.conf

TIA

Reply With Quote
  #4  
Old April 2nd, 2006, 07:02 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 44
Glad SCP is working for you.

Yes, for your website owners, best bet is to run a sandboxed Proftpd setup, as I describe above. No FTP user should have a valid SSH account, period, because once an FTP username/password is sniffed the next thing a hacker will do is try to SSH to that machine with that account.

Also, do some serious reading on FreeBSD security. Best to at least set

kern_securelevel_enable="YES"
kern_securelevel="1"

in /etc/rc.conf, and set NOSUID and NODEV flags for /tmp, since a lot of common exploits involve placing tricky files in /tmp, and that can be done fairly easily with some versions of PHP. See this link for more. You should also spend some time looking through the basic security documents in the FreeBSD handbook, and perhaps do a search on

Do a search at FreeBSD security /tmp at Google.

By the way, the same applies for standard Unix POP3 accounts also: default POP3 on FreeBSD is done with plain-text logins, so if your mail users happen to have SSH login with the same username/password, you are wide open for exploits. Learn to at least set up TLS for mail, but better yet, learn how to divorce mail accounts from Unix shell accounts. I use DBMail for my mail users, which allows me to have mail accounts in a PostgreSQL database, and not at all tied to Unix shell accounts.

Reply With Quote
  #5  
Old April 8th, 2006, 12:02 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,478 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 12 h 33 m 8 sec
Reputation Power: 852
Personally, I would put Apache's tmp dir somewhere besides /tmp (say /var/tmp). You can apply nosuid and nodev to /var as well (or create a separate /var/tmp partition just for apache and apply nosuid, nodev, noexec). Reason for keeping apache's tmpdir on /var/tmp is because /tmp is used by a lot of system daemons for keeping track of system specific things. One of these is sshd, which writes a session file in /tmp every time you ssh into the box. If apache were to fill up the tmp dir (don't laugh, it has happened to me before!), your app will probably quit working and pop error messages. Worse, you can't now ssh into the box and fix the problem because sshd can't write to /tmp as it is now full.
Comments on this post
rycamor agrees: good point, scorp
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > FTP stops working after installing Apache port


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway