Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
BCM
User Panel

Site Notices
Posted: 10/1/2011 2:42:54 PM EDT
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 3:06:42 PM EDT
[#1]
Nobody?  Switched to ProFTPD since it has a GUI admin tool.  Reuploaded site, still getting 403 error.
Link Posted: 10/1/2011 3:09:10 PM EDT
[#2]
Quoted:
...
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 3:11:03 PM EDT
[#3]
Quoted:
Quoted:
...
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 3:12:42 PM EDT
[#4]
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 3:13:04 PM EDT
[#5]
Quoted:
Quoted:
...
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 3:13:10 PM EDT
[#6]
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 3:13:34 PM EDT
[#7]
Ubuntu does indeed have a root user and allen told you how to become it
Link Posted: 10/1/2011 3:13:38 PM EDT
[#8]
wwwdata is the correct user.  You have some other problem.  logs?
Also, you have a uid0.
Link Posted: 10/1/2011 3:13:56 PM EDT
[#9]
Quoted:
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 3:14:03 PM EDT
[#10]
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 3:15:04 PM EDT
[#11]
Quoted:
Quoted:
Quoted:
...
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 3:16:01 PM EDT
[#12]
Quoted:
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 3:16:36 PM EDT
[#13]
Quoted:
Quoted:
Quoted:
Quoted:
...
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 3:17:52 PM EDT
[#14]
Quoted:
Quoted:
Quoted:
Quoted:
...
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 3:27:57 PM EDT
[#15]
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 3:41:09 PM EDT
[#16]
Quoted:
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.

Close Join Our Mail List to Stay Up To Date! Win a FREE Membership!

Sign up for the ARFCOM weekly newsletter and be entered to win a free ARFCOM membership. One new winner* is announced every week!

You will receive an email every Friday morning featuring the latest chatter from the hottest topics, breaking news surrounding legislation, as well as exclusive deals only available to ARFCOM email subscribers.


By signing up you agree to our User Agreement. *Must have a registered ARFCOM account to win.
Top Top