Shell Access

He has: 688 posts

Joined: Feb 2001

I've avoided figuring out what Shell Access is for years but now I'm stuck. I've got a problem where I've somehow lost "ownership" of some of my directories. I can't replace, delete, move, or chmod them because I get a 550 error in my FTP program. The particular situation is outline in this link

So, basicly I'm reading got to type some stuff in to "Shell Access" to fix this.

Quote:
If you have shell access, you can fix it like this:
% cd /path/to/albums
% cd ..
% chmod -R 777 *

How do I actually do this? What free program should I download? Or can I accomplish what I want through cPanel? Thanks!

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

I use AbsoluteTelnet when on a PC and MacSSH PPC when I'm on a Mac
You install it, enter an IP to connect to, put in your username/password, and there you go
Shell access is getting a *nix command line on another PC... a remote connection

Laughing out loud

He has: 1,016 posts

Joined: May 2002

If your account has Telnet/SSH enabled you will have a Java client in CPanel that you can use to log in to the server. I'm guessing you've created these files with a Perl or PHP script which is why they have a different owner? If this is the case, you can use a Perl or PHP script to delete them. If not, I would contact the web host and ask for their help instead of trying to fix it myself when you don't have much prior experience using shell.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

(Note. I'm assuming you're FTP proggy will do CHMOD)

Shell access wont fix this problem. You're FTP account is the same as your shell account (user permission wise). If you can't CHMOD from FTP, you won't be able to from a shell.

What you need to do is find out who the owner is now. If the owner is `nobody` (or whoever Apache runs as, can be found in phpinfo() ), then you can control the chmod using a server-side scripting language.

The other option is to contact your host, and have them fix the owner issue.

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 1,758 posts

Joined: Jul 2002

unless you have root access in which case you can change the ownership yourself:

chown user:group

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

If you have root access, you could just log into FTP as root, and do it there. I'm just stating that shell access along wont do the job.

He has: 688 posts

Joined: Feb 2001

Well I got my host to chmod all the folders in question to 777 which fixed the error messages I was getting. But when I go into my FTP program and try to do anyting to those folders I'm still getting 550 Ownership errors. I know all about setting permissions but how does this ownership stuff work? This part is new to me and it's bugging me that I can't move files in my own site? Can I reclaim ownership?

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

No, you cannot take ownership of any files in a unix environment.

Who is the owner of the files in question?
What actions are you trying to perform on these files that are unsuccessful?

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 688 posts

Joined: Feb 2001

I have no idea who the owner is. The script? Nobody? I created the folder "albums" and then uploaded a whole bunch of stuff from my old site backup to the new server.

Upon further review, I can move, delete, and rename, but I can not chmod anything in that directory. Like I said, it's working now (no errors) but this is new to me and I'm just trying to understand what the deal is.

Confused

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

You can only chmod if you are the owner, so that's why that is not working.

By "Nobody?", do you mean that 'nobody' is the owner? Or don't you know who? (there must be an owner) I'm not sure if you can tell who the owner is with an FTP client (never tried).

How was the backup/restore performed? Did you use a web control panel?

As far as I know, whenever you FTP a file to the server, the owner because the user you're logged in as. If you upload files through a web page, the owner becomes the user that the web server (apache) runs as (usually 'nobody'). That's why I'm interested in how the backup/restor was performed, and what you meant by "Nobody?".

To fix the ownership problem, you'll need to contact your host and ask that they change the owner for you. That will fix your chmod problems too.

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 688 posts

Joined: Feb 2001

It actually says on the pages that the owner is "Nobody" but I don't know if that's just the word that the script uses when it doesn't have the correct name. Otherwise, the files were downloaded from the old site via simple FTP and uploaded to the new site using simple FTP. Nothing was uploaded thru a webpage interface.

Brian Farkas's picture

They have: 1,015 posts

Joined: Apr 1999

I agree with what everyone else here has said - your best bet is to contact your host. It's a very simple thing for them to do and will only take about a minute. Good luck!

Brian

They have: 447 posts

Joined: Oct 1999

assuming these are files created by php, write a php script like so:

<?php
    system
('chown -R yourusername ./*');
   
system('chmod -R 775 ./*');
?>

put it in your document root and execute it.

and from now on, when you create files from php and want to be able to access them yourself also, make sure you chown and chmod them after theyre created

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.