M
M
Minat0_2021-01-24 03:50:07
linux
Minat0_, 2021-01-24 03:50:07

SFTP + SSH access?

Hello, I'm new to managing unix systems, so I need some expert help.
Created a user, conditional `yavicev`.
Connected access to it via sftp via sshd_config:
Link
Prohibited exit from a specific folder via ChrootDirectory.
When I connect, it shows:

/bin/sh: No such file or directory
Connection to localhost closed.

Okay, I thought, I'll give you this file.
Now I have this file in the folder (symbolic link), the user has been given access, sort of.
600cbf010eae7345033157.png
But still the same mistake.

My main goal is to grant access to a specific folder so that the user does not leave the home directory and can run shell script(s) inside.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2021-01-24
@Sanes

So it won't work. Chroot in the console is not so easy.
There was a shell like lshell. See if she's still alive. It's easy to do it there.

A
AVKor, 2021-01-24
@AVKor

Firstly, the OpenSSH settings had to be placed here under the spoiler, and not on an external resource.
Secondly, it had to be configured (there is an example in the config at the end, starting with Match User). When connecting via sftp, the user will not be able to go beyond ChrootDirectory /sftp(for example).
And for chroot via ssh, here it is written how it is implemented.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question