0

I created a PHP file and would like to upload it to var/www folder to Apache2. I use Eclipse and Bluefish for uploading files. It looks like the program does not have root rights.

I would like to know if there is any upload files program, or if the only way to upload files to the server is to use the terminal command sudo cp source destination ?

Any help is greatly appreciated

don.joey
  • 28,662
user3528144
  • 647
  • 2
  • 8
  • 15

2 Answers2

0

Yes, you can upload your files using SFTP (FTP over SSH). You can log in with the same credentials as you're using for SSH.

But I wouldn't enable remote logins for root on your server. The root user can do anything on your server so if you get hacked while remote root logins are enabled anything can happen.

I suggest you just set a password for the www-data user (this is the user that runs Apache2, set a password using passwd www-data) and make www-data the owner of /var/www (chown -R www-data:www-data /var/www).

Now log in with the www-data user and the password you just set (I recommend you to use SFTP instead of FTP as it's more secure) and you should be able to upload your files to /var/www.

Note: You can use a plugin for Eclipse to automatically sync your files with your server using SFTP.

Louis Matthijssen
  • 11,885
  • 6
  • 44
  • 50
0

The interest of application softwares such as Bluefish, Filezilla, WinCp (on Windows) ... is to deal with a remote server.

In your case, it is better to run your above command (sudo cp source destination).

But in both cases, using a software or a terminal command line, your files privileges depend only on how you chmod them (they are not inherent to the software you are using).

If you want to use Eclipse only, without any other software or command line to gain root privileges over your files, you can create symbolic links to your sources using Eclipse itself. You can follow the instructions here: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-45.htm