Problems changing ownership of files in ssh (root)

Discussion in 'Site & Server Administration' started by fracmo, Aug 30, 2008.

  1. #1
    i have installed mfhs

    I used the wget command to move my data over from old host, reinstalled the script and set it all back up! Everything now works...but i moved the user hosted files over via ssh while i was logged in as root. When I log into cpanel, goto file manager...none of the files are there...but when i log into ssh with root - all the files appear. I was told to change ownership..which i did by navigating to the public_html > website > files folder..then using this command:

    chown -R cpanelusername *

    Then to test it, I seen this command:

    chown -Rv cpanelusername *

    It displayed this message for all the hosted files:

    ownership of 'filename.ext' retained as cpanelusername

    But i still cant see the files unless im in ssh and logged in as root?

    Any ideas?
     
    fracmo, Aug 30, 2008 IP
  2. nimhost

    nimhost Active Member

    Messages:
    235
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    check the chmod permission :)
     
    nimhost, Aug 30, 2008 IP
  3. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #3
    You should be able to list the files with any user (depending on directory permissions), but get "permission denied" when you try to do anything. I, therefore, doubt it's permission wise. The files just aren't in that directory.

    Jay
     
    jayshah, Aug 31, 2008 IP
  4. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Its simply not working because your chown command is not changing the ownership for the group. Cpanel runs on the same system username and group name. Thats why running the following command:

    chown -R cpanelusername *

    won't really do the impressive changes for you.

    Run the following command which should work with you:

    chown -Rf cpanelusername:cpanelusername *

    Have a great day ;)
     
    mellow-h, Aug 31, 2008 IP
  5. fracmo

    fracmo Banned

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi guys,

    Thanks for the input...but this morning i decided to just move the data over again but using the same account in cpanel rather than the root account. Setup my website and it picked the files up...I have taken the command down and saved it in my notes. I hope I wont need to move servers again for a while...but it will come in handy for when I do :)

    My website is now working again, so thanks for the folk who helped along the way! Just need to make it more secure and that should be me!
     
    fracmo, Aug 31, 2008 IP