Y
Y
You Care2016-03-11 00:50:13
SSH
You Care, 2016-03-11 00:50:13

Ubuntu 14.04. How to restrict ssh user movement to his home directory, and better not to his home directory but to another one?

Hello.
There are 2 hostings, from one to the other you need to download the file via ssh via php.
Is it possible to prevent a specific user from leaving the specified directory?
These recipes didn't help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
paran01k, 2016-03-11
@paran01k

In sshd_config:

Match User someuser
    ChrootDirectory /some/directory

Also, "man sshd_config" says:
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), 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 may require /dev/log inside the chroot directory on some operating systems (see sftp-server(8) for details).

N
Nadz Goldman, 2016-03-11
@nadz

ssh chroot will save you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question