Results 1 to 2 of 2

Thread: Lock users in their home directory

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Lock users in their home directory

    Hi,

    i have a private hosting company and i will have much users on my dedicated server, when i do adduser command and add an user he can go to all directorys.
    How i can lock him in his home-directory?

    Example:

    User: Max

    He only can stay in /home/Max not /home !

    Much people say with chroot, but i don't know how to use it.

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,371
    Thanks
    17
    Thanked 754 Times in 496 Posts
    Rep Power
    10

    Default

    For SSH / SFTP use ChrootDirectory directive. See


    ChrootDirectory
    Specifies the pathname of a directory to chroot(2) to after
    authentication. All components of the pathname must be root-
    owned directories that are not writable by any other user or
    group. After the chroot, sshd(8) changes the working directory
    to the user's home directory.

    The pathname may contain the following tokens that are expanded
    at runtime once the connecting user has been authenticated: %% is
    replaced by a literal '%', %h is replaced by the home directory
    of the user being authenticated, and %u is replaced by the
    username of that user.

    The ChrootDirectory must contain the necessary files and
    directories to support the user's session. For an interactive
    session this requires at least a shell, typically sh(1), and
    basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4),
    stderr(4), arandom(4) and tty(4) devices. For file transfer
    sessions using ``sftp'', no additional configuration of the
    environment is necessary if the in-process sftp server is used,
    though sessions which use logging do require /dev/log inside the
    chroot directory (see sftp-server(8) for details).

    The default is not to chroot(2).
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Solved] sftp Home directory config
    By duster in forum CentOS / RHEL / Fedora
    Replies: 2
    Last Post: 24th May 2011, 06:05 PM
  2. Linux client home directory on server2003 AD
    By harshana in forum File Servers
    Replies: 3
    Last Post: 19th November 2009, 03:41 PM
  3. Problem reading home directory
    By jkRoswell in forum Ubuntu / Debian
    Replies: 3
    Last Post: 8th October 2009, 06:50 AM
  4. Jailing vsftpd user to home directory
    By grifs71 in forum CentOS / RHEL / Fedora
    Replies: 2
    Last Post: 26th December 2007, 12:56 AM
  5. sendmail and mysql/user without home directory
    By asim.mcp in forum Getting started tutorials
    Replies: 0
    Last Post: 7th July 2007, 03:41 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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41