Find the answer to your Linux question:
Results 1 to 8 of 8
I'm trying to figure out how to disable a user from viewing others' files in SSH & FTP. I'm running Redhat Linux 9, and by default,a user once is logged ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    6

    Disable Users From Viewing Others' Files


    I'm trying to figure out how to disable a user from viewing others' files in SSH & FTP. I'm running Redhat Linux 9, and by default,a user once is logged in (via FTP or SSH), he/she is able to view files in other user accounts and other system files.
    Anyone knows a good article on this issue or having any tip?

    Thanks in advance.

    Edit: sorry, seems that I posted in wrong forum, pls move to appropriate forum.

  2. #2
    Linux User oosterhouse's Avatar
    Join Date
    Jan 2006
    Location
    Grand Rapids, MI
    Posts
    318
    I think you can set the permissions of directories or files so certain users can't view them. Not completely sure though. Google permissions in redhat and you'll find an answer.

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    6
    Thanks for the tip, but I already tried that. If I set group with no read and execute permission, the user's site ain't viewable to others in the LAN.

  4. #4
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    682
    If you set the users home directory permissions to 0701 then other people will be able to cd into the directory but not list anything. Then chmod the users public_html directory to 0755. People (and the web server) will then be able to cd into their ~/public_html directory so they will show up on the website.

    If getting into other users public_html directories is a problem, you might be able to set the group of the users public_html directory to a group the webserver user is in and then set the permissions of the public folder so only the owner and group have access.

    Code:
    chown <user>.web ~/public_html
    chmod 750 ~/public_html
    You may need to do some configuration on the webserver to make that work though.

    Let us know how you get on

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  5. #5
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,885
    Quote Originally Posted by kakariko81280
    ...
    You may need to do some configuration on the webserver to make that work though.
    ...
    It might be as simple as making sure that the user the web server runs as (apache or httpd usually) is added to the group for each user. The user's group can then easily be given read but not write access to the home (and the public_html) directories.
    Linux user #126863 - see http://linuxcounter.net/

  6. #6
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    239
    What ftp server are you using? most have an option to chroot the users who log in - this means they cannot leave there own home directory...


    not sure how to do this with ssh, but i am sure it is possible..

  7. #7
    Just Joined!
    Join Date
    Jan 2006
    Posts
    6
    I'm using ProFTP. I don't know if anyone heard of jail-shell, as in cPanel, users can't leave their own directory, but I don't know if there's any script has this same feature.

  8. #8
    Just Joined!
    Join Date
    Jan 2006
    Posts
    6
    Got this figured out. Thanks all for the help.

Posting Permissions

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