1 |
Hello. I am using a script tool to backup the apache uploaded files |
2 |
(through ssh) on the web server. These files resident in a folder that |
3 |
belongs to 'apache' user. Each time a user upload a file within the web |
4 |
application, the uploaded file stays in that folder with mod 700. |
5 |
|
6 |
Because only apache user could read that file (700 permission), it makes |
7 |
it difficult to receive the files through ssh. This is what I did: |
8 |
1) on the backup box (not the web server), create user apache, generate |
9 |
dsa key pair for it. |
10 |
2) on the web server, create /home/httpd, put the public key of |
11 |
apache@backup_box in ~apache/.ssh/authorized_keys |
12 |
3) on the web server, allow apache user login (by changing its shell |
13 |
from /bin/false to /bin/bash) |
14 |
4) run the backup script on the backup box as apache. |
15 |
|
16 |
This raises a security problem. apache user being to be able to login |
17 |
through ssh. I am not very experienced to tell how dangerous this could |
18 |
be. I think I am not going to suffer from ssh dictionary attack, very |
19 |
simple reason: user apache (should) have no password, and ssh password |
20 |
login is turned off on web server. However, is there any other risks |
21 |
that could be caused by setting apache user's login shell to bash? |
22 |
|
23 |
Another idea might be changing all the uploaded file permission to |
24 |
something like 740, but new files are uploaded every day, they are |
25 |
automatically given permission 700. |
26 |
|
27 |
Thank you! |