LinuxQuestions.org
Help answer threads with 0 replies.
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-11-2007, 09:31 AM   #1
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Rep: Reputation: 31
apache .htaccess file...Is my site safe?


If I use .htaccess and .htpasswd to control access to the content of a directory for my webserver, am I able to rest fairly easy that it is secured assuming I am using an uncompromised password? Also, is the password transmitted as plain text from client to server??? Thanks.

- Jim
 
Old 08-11-2007, 11:10 AM   #2
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
Whether the password is sent in plain text or not is not dependent on the apache authentication. It's dependent on whether you use https or not. As for if you can be sure that the apache authentication is uncompromisable, there's obviously no guarantee. Make sure you update your apache often and change password at even intervals.
 
Old 08-11-2007, 03:55 PM   #3
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Original Poster
Rep: Reputation: 31
thanks bakfupai. Any idea what to look for in apache to make the password encrypted. I know when I run
Code:
htpasswd -c .htpasswd user
It is implied that the -d flag is thrown to force CRYPT encryption. Thanks again.

- Jim
 
Old 08-12-2007, 05:57 AM   #4
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
I didn't explain it clearly enough. As far as I know, all passwords are encrypted when using htpasswd or htdigest. This means someone can't pull your .htpasswd and just read all your password. Not easily anyway, they can still run a dictionary or brute-force attack on it. The best is to prevent someone from pulling the file.

I suggest you look at this:
http://httpd.apache.org/docs/2.2/howto/htaccess.html

Anyway, with HTTPS I mean that you need to start the apache server in SSL mode. This means all connections to and from the server are encrypted . For info on how to implement this, look here:
http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html
 
Old 08-13-2007, 07:25 AM   #5
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Original Poster
Rep: Reputation: 31
thank you. This has been really helpful. I am probably going to stick with the .htaccess method because I am thinking https may be a little overkill for what I am looking for. you've been helpful bakfupai.

- Jim
 
Old 08-14-2007, 06:17 PM   #6
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
.htaccess authentication only stops http attempts to access. Does nothing for ftp or ssh.
 
Old 08-14-2007, 08:55 PM   #7
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Remember that using the Basic authentication type (mod_auth_basic) sends usernames and passwords in cleartext:
Quote:
From the apache Authentication, Authorization, and Access Control howto:
It is important to be aware, however, that Basic authentication sends the password from the client to the server unencrypted. This method should therefore not be used for highly sensitive data, unless accompanied by mod_ssl.
If you want encrypted usernames/passwords use Digest authentication instead.
 
Old 08-15-2007, 07:57 AM   #8
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jiml8 View Post
.htaccess authentication only stops http attempts to access. Does nothing for ftp or ssh.
Thats all I need. My intention is to stop individuals from accessing some of my directories through HTTP. I don't want to be arrogant, but I don't think SSH is at all compromised.

Sidenote! I have been wrong in the past. Someone took over and changed the password on a router I was using on the internet side to re-enable port forwarding to my open relay mail server. Too bad my server is off site. That was bummer for me. Open relay has since been fixed.

Thanks jim18,

- Jim
 
  


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
web site directory security? .htaccess or httpd.conf Moonman Linux - Software 0 03-03-2006 08:51 PM
Apache and .htaccess jamluv Linux - Security 9 06-03-2005 02:53 PM
Apache/2.0.51 .htaccess 2782d4 Linux - Software 2 02-08-2005 12:12 PM
how safe is .htaccess? groovin Linux - Security 6 11-21-2002 04:29 PM
Apache & the .htaccess file robeb Linux - Software 1 05-15-2002 10:56 PM

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

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