Portal Home > Knowledgebase > Articles Database > SFTP to server NOT using root


SFTP to server NOT using root




Posted by Kung!, 10-24-2009, 11:47 PM
Ok, direct root logon to a server is disabled; using another login, obviously. However, I need to be able to SFTP files from my computer to a directory on the server using said login - yet it does not have correct permissions, evidently, and therefore can't even see the directory I need to be able to SFTP files to. Tried CHOWNing the directory with that usename, giving it 777 permissions, etc. Doesn't work. Any ideas?

Posted by Drolli, 10-25-2009, 03:03 AM
Have you checked the permissions for the parent directory of your directory? If you cannot see the directory you are looking at probably the parent directory is not allowing it, eg. /a/b/c/d -> d is the direcotry you want to work with and c does not allow you to see any file in it. What is showing: ls -ld /a/b/c/d ls -ld /a/b/c But it is not a good idea to change a directory permission to world-wide readable. Depending on the directory you should include the user in the group owning the directory or work with ACL.

Posted by Website themes, 10-25-2009, 05:29 AM
Move it to a directory you can access and then ssh in, su to root and move the files to correct location.

Posted by fwaggle, 10-25-2009, 09:21 AM
I would suggest you stop, and read up on UNIX-style permissions and actually figure out where the issue is, rather than going around giving everyone that ever ends up with so much as a process on your machine access to everything. For starters, Drolli's answer could be correct. You could also (though I'm not sure of any system that does it for you without you asking) be in a jailed SFTP server. Shell in as the user, then start checking permissions up the directory tree until you figure out why you can't access it. Then correct that permission in the most conservative way possible. I hate the knee-jerk reaction of people to chmod 777 something at the first sign of a permissions problem - why not just chmod -R 777 / and avoid permissions issues all together?

Posted by bizness, 10-25-2009, 09:25 AM
I would agree with this comment.

Posted by Kung!, 10-25-2009, 09:41 AM
You're making assumptions. I said I tried that...I did NOT say I LEFT permissions like that. I executed the command to see if that did help. Did not, so I changed permissions back. Next time, ask what I specifically did instead of assuming. As it turns out I could do it using Website theme's suggestion. Thanks.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Zeus Partner program (Views: 493)