You are not logged in.

#1 2011-12-08 18:27:28

NightCrawler03X
Member
Registered: 2010-07-23
Posts: 8

Adding a password for the http user

Hi,

I searched the forum and elsewhere for an answer to this, but found nothing conclusive.

I am using Arch Linux to setup a webserver.

For SFTP access I use OpenSSH server, as this also provides SFTP.

When I login to an account with SFTP, I am brought to the home directory of that user.

Is it possible, to create a password for the http user, and login directly with "http" and the password that you set, and be able to upload files directly to the /srv/http directory?

I know that it is possible to use virtual hosts, and create a vhost with the document root as a users /home directory, with that user only used for uploading files.

In the past I would have don something like this.  Either that, or I would upload to another account, then SSH into a shell and move those files to /srv/http as root.

Or, in the past when I was using Debian Linux to run webservers, I would simply do:

# chown -R username /var/www

All thoughts and tips welcome. Thank you for your time.

Last edited by NightCrawler03X (2011-12-08 18:28:39)

Offline

#2 2011-12-08 18:32:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Adding a password for the http user

IIRC http is a "mock" user that uses /bin/false as its shell, not sure if what you want would work.

Offline

#3 2011-12-08 18:48:24

NightCrawler03X
Member
Registered: 2010-07-23
Posts: 8

Re: Adding a password for the http user

Hi Karol,

Thank you for your response, but I already know that the shell for http is /bin/false, which mean sthat you cannot execute commands as http. This is a secure configuration, the default configuration, and one that I wish to keep, in order to maintain that level of security.

To clarify,
I am not looking for gaining shell access with the http user, I am simply looking for SFTP access.

I know that all you need is

passwd http

What Im really asking is, is there a better way, or is this actually sensible. I do not want to make my system less reliable/secure, especially when it comes to apache.

OpenSSH server grants remote shell access for a given user, but it also provides SFTP access. I could use vsftpd with SFTP enabled, but I would rather use just one program, and OpenSSH provides both shell and SFTP access (among other things).

For example, if I have a user named dave, I can SSH into the server with FileZilla (an FPT client) using port 22, and I get SFTP access, rather than shell access as I would do with, for example, Putty. In both cases, the current directory when first logging in, would be that users home directory. In this case, logging in with SFTP using the http user, would by default put me in /srv/http with FileZilla (desired, but currently not the case), but would leave me nowhere with Putty as the http uses the "false" shell (also desired, and currently the case)

So, my question is really, how can I make SFTP access to my /srv/http direct -- so that I simply login as http.

Thus, the question is whether or non I can set a password for http, to do exactly that.

My second question, which I did not ask at first, is, are there any security implications in doing so, and what configuration is needed in order to make it secure?

Finally, are there any other implications that such a configuration would have?

Alternatively, is there a better way of doing this (and possibly more secure way)?

This, from my point of view, would make configuration much simpler.

Thoughts welcome. Thank you for your time.

Last edited by NightCrawler03X (2011-12-08 18:59:55)

Offline

Board footer

Powered by FluxBB