Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
Member Login

Site Notices
Posted: 10/1/2011 1:42:54 PM EST
So I setup Ubuntu on a spare box I have lying around so my wife and I can work on the website for our future farm. Have apache up and running as well as vsftpd for FTP. Got the site files uploaded, but they are not viewable. The permissions are setup so only the wwwdata user can read the files, and therefore none of the site can be viewed. What do I need to change to make them globally viewable. Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).
Link Posted: 10/1/2011 2:06:42 PM EST
Nobody? Switched to ProFTPD since it has a GUI admin tool. Reuploaded site, still getting 403 error.
Link Posted: 10/1/2011 2:09:10 PM EST
[Last Edit: 10/1/2011 2:09:28 PM EST by kelone]
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root


Link Posted: 10/1/2011 2:11:03 PM EST
Originally Posted By kelone:
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root




Fail

Correct command:
sudo su -
Link Posted: 10/1/2011 2:12:42 PM EST
You need to set an appropriate umask in vsftpd.conf 022 is what you want

That "masks" out the write permission Read=4, Write=2, eXecute=1 7 is rwx The mask is opposite... 0 means don't mask anything. 2 says mask out write, so you're left with r-x, or 5
Link Posted: 10/1/2011 2:13:04 PM EST
Originally Posted By kelone:
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root




Any help with my file permission errors?
Link Posted: 10/1/2011 2:13:10 PM EST
[Last Edit: 10/1/2011 2:13:41 PM EST by kelone]
If you are talking about file premission, then
chmod -R a+r /path/to/wwwdata/*

will let everyone read all files in all subdirs

There is a bunch of stuff in the apache setup file (I forget name/where it is), and I am pretty sure I had to mess with those setting for a while to get it working
Link Posted: 10/1/2011 2:13:34 PM EST
Ubuntu does indeed have a root user and allen told you how to become it
Link Posted: 10/1/2011 2:13:38 PM EST
wwwdata is the correct user. You have some other problem. logs?
Also, you have a uid0.
Link Posted: 10/1/2011 2:13:56 PM EST
Originally Posted By Keymaster4225:
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


You want to sudo things that require root. It's supposed to be a bit of a PITA.
Link Posted: 10/1/2011 2:14:03 PM EST
As for the OP.

Adjust your ftp client to set permissions to world readable after the upload (permissions rwxr-xr-x, aka 755). If this doesn't work, make sure that SITE_CHMOD isn't disabled in the ftp server.

Whatever you do, do NOT change the ftp daemon to upload the stuff as the wwwdata user; this will mean any bug or hole in the webserver or code running on it will allow files to be modified/compromised or deleted. Just get the permissions right.
Link Posted: 10/1/2011 2:15:04 PM EST
Originally Posted By allenNH:
Originally Posted By kelone:
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root




Fail

Correct command:
sudo su -


How is it fail? It let him set the root password, and now he can log in as root and not fuck about with sudo

Link Posted: 10/1/2011 2:16:01 PM EST
Originally Posted By Keymaster4225:
So I setup Ubuntu on a spare box I have lying around so my wife and I can work on the website for our future farm. Have apache up and running as well as vsftpd for FTP. Got the site files uploaded, but they are not viewable. The permissions are setup so only the wwwdata user can read the files, and therefore none of the site can be viewed.


What do the web server logs say?

I'm guessing 'wwwdata' is the user the web server runs is, so that's the only user that needs read permissions. The web server config may be blocking at the .htaccess level
Link Posted: 10/1/2011 2:16:36 PM EST
Originally Posted By kelone:
Originally Posted By allenNH:
Originally Posted By kelone:
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root




Fail

Correct command:
sudo su -


How is it fail? It let him set the root password, and now he can log in as root and not fuck about with sudo



"fucking about with sudo" is The Right Way(tm). And of course you mean su to root, not login. If you're logging in remotely as root you're fucking up big time.
Link Posted: 10/1/2011 2:17:52 PM EST
Originally Posted By kelone:
Originally Posted By allenNH:
Originally Posted By kelone:
Originally Posted By Keymaster4225:
...
Keep in mind Ubuntu doesn't have a root user so I have to sudo everything (pain in the ASS).


sudo passwd
newrootpassword
newrootpassword


su root
newrootpassword

you are now root




Fail

Correct command:
sudo su -


How is it fail? It let him set the root password, and now he can log in as root and not fuck about with sudo



Without the - you do not inherit root's environment

But "just log in as root" is a TERRIBLE idea. Find and fix the problem. Running as "root" is why Windows systems are so readily cracked. A lot of the issues people have with Windows, they wouldn't have if they ran as a regular user and only logged in with administrative privileges when necessary.
Link Posted: 10/1/2011 2:27:57 PM EST
[Last Edit: 10/1/2011 2:41:08 PM EST by Keymaster4225]
Ok, got the root stuff taken care of. The /var/www directory is world-readable, and I can now view files on the site, but for some reason it isn't loading Index.html when I plug in the website to a browser. It just shows a dir listing. ALSO, when I click on index.html, it's not showing and graphics/formatting/etc just text and a few links. Gah. I'm about to go back to Win7 and run Apache off of that. LOL.


ETA: Ok, got the permissions straightened out completely, site will display completely, EXCEPT, it's still dir listing instead of loading index.html. WTF apache.
Link Posted: 10/1/2011 2:41:09 PM EST
[Last Edit: 10/1/2011 2:43:11 PM EST by allenNH]
Originally Posted By Keymaster4225:
Ok, got the root stuff taken care of. The /var/www directory is world-readable, and I can now view files on the site, but for some reason it isn't loading Index.html when I plug in the website to a browser. It just shows a dir listing. ALSO, when I click on index.html, it's not showing and graphics/formatting/etc just text and a few links. Gah. I'm about to go back to Win7 and run Apache off of that. LOL.


In your apache config you need to set DirectoryIndex to include index.html

A common statement for that, for php users, is:

DirectoryIndex index.php index.html index.htm

ETA:
While your at it, disable that file listing stuff entirely. Look for "Indexes" or "+Indexes" in Option and Directory blocks, remove it wherever you find it. Just a security breach waiting to happen.

Top Top