Question about logging in as root and using PHP. Ubuntu

Hey there!

I have just started using Linode and are now jumping feet-first into this world. So along comes some small questions i have tried, all night, to get answered. I should have answers for this but no luck.

I have just installed apache on my Ubuntu 9.10 32bit and along with it i use dyndns, sucessfully. Allthough i have not ventured deeper into it at this point (that have to wait after i get some sleep) i am able to enter the url and can see the file i have put in the public_html folder.

But, security issues comes to mind when i SSH in as root, and then have to put the files into the folder as root since it is in the /etc folder. Am i just too paranoid due to my lack of knowledge or should i SSH in as a regular user and as a regular user put the files into the folder? I know i should SSH in as a regular user, but with the folder in /etc i have to be root to work in the folder.

If i install php can i stilll use html files, or will i have to make the site with php?

And, as of now, my last question. When i now have set it up as a webserver, can i still install other things as screen and irssi, use it as a ntpd server and such without breaking the LAMP install and/or make it more "insecure"?

I will appreciate any help with pointing me in the right direction getting answers for these questions.

EDIT: changed the title

3 Replies

1. What I would do is chown the public_html directory to your user and then make the changes as that user.

2. HTML files can live fine alongside PHP.

3. Well, every additional service makes a server less secure. But you should be able to do it fine. I do it all the time.

Then i will chown it. Why didnt i think of that :roll:

Brilliant. I will continue to install then.

The fact it become less secure is something to keep in mind. Got to keep it at a minimal then.

Thanks alot for taking the time to answer my questions. Appreciate it :)

Many break-in attempts on ssh are aimed at the root user, so it's a good idea to set "PermitRootLogin no" in /etc/ssh/sshd_config. First, however, add your normal user account (I'm using cimeies in this example) to the admin group with usermod -a -G admin cimeies.

Now instead of logging in as root, you'll login as the cimeies user but will be able to use sudo to accomplish tasks that must be done as root.

An alternative is to use "PermitRootLogin without-password" and use key authentication for logging in as root.

(The above is true for 8.04 - I assume 9.10 works the same.)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct