Permissions w/ Ubuntu Server 9.10 using SFTP (WinSCP3)

I recently installed a copy of Ubuntu Server 9.10 and I’m trying to get the SSH / SFTP to work as it should. Currently, whenever I try to delete a file or folder I receive the following error message:

Permission denied.
Error code 3.
Error message from server: Permission denied
Request code: 13

This has to do with my installation of SSH on the Linux box but I’m unsure as to what I’ve done wrong. I’m no longer at home (I’m in the office now) and still, it’s not letting me do things with the files. It’s strange because I can log into the server using WinSCP3 just like any other time I log into a server, but when I try to do anything to the files or folders, I get rejected…

My knowledge of Ubuntu Server is slim at best, so any insight into this is appreciated.

What user do you use to log in? (root or other user?)

To whom belong the files you want to delete?

Probably the problem lies here. User A cannot just delete from user B, unless user A is root, which is allowed to do everything. I’m not saying you should log in as root, that’s not really safe afaik.

Honestly, I’m unsure about what I’m using due to reading that sudo is and is not the same as root… I’ve been using sudo (?) to install everything, which from what I understood was root. The irony is that you’re right about ownership being a possibility because I’m sitting here right now looking at the owner of all the folders / files and it looks like a lot are “owned” by root while the others are owned by sudo (?). Am I completely lost here? The owner name I chose, we’ll just say is named “John” and the majority of these resources seem to be owned by “John” while others are owned by “root.”

sudo has nothing to do with SSH/SFTP.

What is the username you use to log in with SSH/SFPT, is it root or John?

If it’s John you can only delete files owned by John, if it’s root you can delete any file you like.

PS. Files being owned by sudo!? That’s weird …
Sudo is the same as “temporary root”, i.e., the command you put “sudo” for is excecuted as if you were root, although you’re not logged in as root.
AFAIK there is no user named sudo and therefore files should be not owned by sudo.
I might be wrong here as I’ve never used Ubuntu Server, but only Debian. And yes I know, Ubuntu is based on Debian, but I still feel they are completely different OS’es :slight_smile:

So how would I then make the LAMP installation work with my “John” account? When I was installing everything for this box I was doing so using sudo because I read that this is a preferred approach when installing things on the server. Besides, if I was using sudo, that would then mean that I’m using “John” which would mean then that the LAMP (www stuff) should also be under “John” ownership…

All this is crazy! (P.S. - Sorry for the late response…)

No, all the LAMP stuff (apache executables etc) should be owned by apache (on Ubuntu it’s owned by the user “www-data” I believe, at least on Debian they are).

However, all your PHP files and HTML files could be owned by “John”, that’s fine. That way John can edit the files, apache/php can read the files, and all is well with the world :slight_smile: