Web lists-archives.com

Re: chroot jail for user with rssh




On 28.03.19 08:21, Peter Wiersig wrote:
> basti <mailinglist@xxxxxxxxxxxxxxxx> writes:
> 
>> sftp -vv user@xxxxxxxxxxx
>> Transferred: sent 2508, received 2260 bytes, in 0.2 seconds
>> Bytes per second: sent 15924.1, received 14349.5
>> debug1: Exit status 1
>> Connection closed
>>
>>
>> scp -vv user@xxxxxxxxxxx:/foo /tmp
>> Transferred: sent 2508, received 2304 bytes, in 0.2 seconds
>> Bytes per second: sent 15051.0, received 13826.7
>> debug1: Exit status 255
>> (...)
>> I have no idea anymore whats wrong and how can I debug.
> 
> You can't debug such setups from the client side.
> 
> Have a look in /var/log/auth.log on the server and if that doesn't help:
> 
> a) if necessary modify the firewall
> b) launch sshd on a different port with no backgrounding and debug
> output
>   => sshd -d -p 1234
> c) retry above steps with the alternate port
> 
> Peter
> 

Hello Peter,
thank you for this info.
I have try sftp:

/usr/sbin/sshd -d -p 2222

debug1: subsystem: exec() /usr/lib/openssh/sftp-server
Starting session: subsystem 'sftp' for alice from 2.206.185.146 port
45292 id 0
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 12046
debug1: session_exit_message: session 0 channel 0 pid 12046
debug1: session_exit_message: release channel 0
Received disconnect from 2.206.185.146 port 45292:11: disconnected by user
Disconnected from 2.206.185.146 port 45292
debug1: do_cleanup
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials
debug1: audit_event: unhandled event 12



Try scp:

/usr/sbin/sshd -d -p 2222

debug1: PAM: establishing credentials
Changed root directory to "/home/alice"
debug1: permanently_set_uid: 1001/1001
debug1: rekey after 134217728 blocks
debug1: rekey after 134217728 blocks
debug1: ssh_packet_set_postauth: called
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 0 win 2097152 max
32768
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype no-more-sessions@xxxxxxxxxxx
want_reply 0
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request exec reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req exec
Starting session: command for alice from 2.206.185.146 port 45296 id 0
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 12078
debug1: session_exit_message: session 0 channel 0 pid 12078
debug1: session_exit_message: release channel 0
Received disconnect from 2.206.185.146 port 45296:11: disconnected by user
Disconnected from 2.206.185.146 port 45296
debug1: do_cleanup
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials
debug1: audit_event: unhandled event 12