Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2009
    Posts
    39

    Help with ssh commands

    This is my first post with WHT but I've been a lurker for a long time now. I have my own dedicated server to host my own websites and eventually will look at offering hosting services once I get a handle on it. My question is how do I find my websites using putty? I've typed ls, ls -al, cat, and a few other commands that I've found on the net but cannot seem to get into one of my sites so I can chown a file to a different user. I cannot seem to find any tutorials that aid with work on website files as opposed to root files. Tried going into root/public_html but only found three directories and none were the websites on the server. Thanks in advance.

  2. #2
    Join Date
    Apr 2005
    Posts
    1,711
    Here's a little copy-and-paste snippet for you that a buddy of mine made

    ref: http://mindbend.org/scripts/cpanel-utilities
    (modified for your usage)

    for i in `cat /etc/userdomains | cut -d":" -f1`;
    do s=$(grep -niC3 \ $i /usr/local/apache/conf/httpd.conf|grep DocumentRoot \
    |awk '{ print $3}');
    printf "%-30s" ${i} " - "${s}; printf "\n";
    done

  3. #3
    Join Date
    Apr 2005
    Posts
    1,711
    As far as chowning a file to a different user:

    You can do this:

    chown USER.USER <file/dir>

  4. #4
    Join Date
    Sep 2009
    Posts
    39

    Thumbs up

    zacharooni, thanks very much. Just what I needed.

  5. #5
    And if you want to change the ownership of multiple files/folders, you can use :
    Code:
    sudo chown -R username_of_new_owner foldername

  6. #6
    Join Date
    Sep 2009
    Posts
    39
    Does this change the ownership for all files and folders within the directory or do I have to separate every file and folder?

  7. #7
    The command sudo chown -R username_of_new_owner foldername will assign username_of_new_owner to every file and folder withing foldername, including foldername. The -R switch in the command means recursive.

  8. #8
    Join Date
    Sep 2009
    Posts
    39

    Thumbs up

    Yeah I thought so but wanted to make sure. Thanks everyone for helping me out. Learning more everyday thanks to generous souls like yourselves.

Similar Threads

  1. Fun with DNS: Three Useful Commands
    By manatee123 in forum Hosting Security and Technology Tutorials
    Replies: 1
    Last Post: 12-25-2005, 02:01 PM
  2. /me commands
    By -Edward- in forum Programming Discussion
    Replies: 4
    Last Post: 12-23-2005, 12:09 PM
  3. RPM commands
    By Kuroro Luc in forum Hosting Security and Technology
    Replies: 9
    Last Post: 06-20-2004, 03:38 AM
  4. Is it possible to allow only some commands?
    By MultiVol in forum Hosting Security and Technology
    Replies: 14
    Last Post: 09-01-2002, 09:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •