Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
well that's just different virtual hosts, nothing specifically interesting about that, but the issue is that you can't serve two certificates from a single ssl port. So if you want this, you would need 2 IP addreses, or use a different port than 443 for one of them.
What you can often do is use SAN's (Subject Alternative Names) in a certificate to hold two hostnames in a single cert, and then that covers both sites just fine, but you have no idea what site is being requested when an SSL connection is being set up, so you can only provide one cert.
What I'm trying to achieve is a bit similar to having different ftp-users.
There is 1 FTP-server, but each user only has access to there own (sub)directory.
I want the same with https : 1 webserver, different directories, each user only access to there own directory
oh, right, so you want to jail a user to a specific directory? That's easy enough, just use an htaccess directive to only allow certain users in certain places. you can do this with .htaccess files in each directory, or centrally in your httpd.conf file.
and so then .htaccess to password protect directories to 1 user
So first, the user must show his identity with the ssl-certificate, then he is "chowned" into his own directory and there he needs to give once more his username and password.
Sounds safe enough for a public http-server ??
Maybe I need to tell you why I need this safe https-server : I would place configuration files in these directories.
Last edited by jonaskellens; 12-13-2012 at 05:57 AM.
SNI is no use here, you're only looking at using one server. TBH, I didn't realize SNI is officially as well supported as it appears to be, so didn't mention it originally. But either way, you're looking at using client certificates to identify a user, which is fine, but that's not affecting the server cert at all.
Using a user/pass AND a client cert seems like overkill to me. client certs are usually an alternative solution, not a complimentary one.
I don't like the individual files, and apache foundation officially recommend not using them, and putting the directives in httpd.conf instead. However they are good for understanding how the jigsaw fits together a bit easier.
the htaccess stuff will only allow certain users in certain directories, that's all you really seem to want. The SSL stuff is just bog standard SSL, no user specific angle on it.
I will point out a possible oversight on how apache actually works...
Any file apache has access to can read, and (unless ownership/security labeling blocks it) can also be updated.
User identification stops at the apache web server. It can identify a user... but it can not reliably partition the data apache has access to. Once the server is entered, any bug in apache can be used to access any file the apache user id has access to.
This is unlike ssh, where each user is separately identified to the kernel.
All apache logins look the same...
Now this applies mostly to the CGI applications. Basic file access is still handled by apache (beware PHP useage - this is a CGI and no CGI has effective identity)
Maybe it'd help if you thought of those as domains, or Hosts (really <VirtualHosts *:80>) and not actual breathing end-users.
Now, they very well could be called /user[123] and you have every right to do so.
Your "users" are seen as "clients" in terms of the apache service daemon. It's a client-server world.
Unless user1,2, and 3 all sit in the same chair, how would user3 even 'know' about /user[12] url?
My end goal also is to only allow users with the right client ssl-certificate to enter the directory.
All the other attempts to access the webserver of a certain directory need to be rejected.
How can I do this ?
I would give every client a (self-signed) certificate, which has been signed by my own CA, to give access.
How do I reject all other requests on port 443 ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.