H
H
hrvasiliy2015-07-24 09:50:29
SSH
hrvasiliy, 2015-07-24 09:50:29

What is causing the connection problem?

What am I trying to do? - Add a specific user to a specific folder on the server.
What do I end up with? - I get an error when connecting via SSH:

[SSH] Server Version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
[SSH] Logged in (password)

[SSH] ERROR: Read from remote host MYIP: Удаленный хост принудительно разорвал существующее подключение

[SSH] FAIL: Write failed: Удаленный хост принудительно разорвал существующее подключение


[SSH] INFO: DISCONNECT

What have you been doing?
- Added ubuntu user for specific directory.
- Added a password to the user.
- Changed "sshd_config" settings:
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

Match User john
    ChrootDirectory /home/john
    ForceCommand internal-sftp
    AllowTCPForwarding no
    X11Forwarding no

- Restarted SSH
What's interesting is that without editing the sshd_config file, I can connect to SSH, so I don't quite understand why they should be added there at all. At the same time, other problems appear, for example, the user can "walk" through all the directories of the server (he has read-only rights), and the second problem: when trying to view the history of commands by pressing the UP buttons, DOWN does not show the history, but shows "^[[A ", "^[[B".

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
V
Vlad Zhivotnev, 2015-07-24
@inkvizitor68sl

> What am I trying to do? - Add a specific user to a specific folder on the server.
The error is here.
You shove the user into the sftp chroot, the console will not work for him in this case in any case (if only because he does not have access to / bin / bash).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question