micneu schrieb:
DerTom246 schrieb:
wie soll das gehen wenn er sich nicht anmelden darf?
/mnt/backup_pool
ForceCommand internal-sftp -d /%u
Mit der Option '-s /usr/sbin/nologin' kriegt der sftp-user keine Shell - wenn ich die Erläuterungen richtig gelesen habe, dann hat dies für den sftp-Dienst keine Auswirkung.
Hier die Abfrage der Rechte:
/mnt/backup_pool/
total 2
drwxrwxr-x 4 root root 4 Feb 22 14:04 .
drwxr-xr-x 1 root root 22 Feb 21 18:26 ..
drwxr-xr-x 3 root root 3 Feb 22 14:04 minio_pool-dont_touch
drwxr-xr-x 3 root root 3 Feb 23 12:41 sftp_pool
/mnt/backup_pool/sftp_pool/
total 2
drwxr-xr-x 3 root root 3 Feb 23 12:41 .
drwxrwxr-x 4 root root 4 Feb 22 14:04 ..
drwx------ 2 tom sftpgroup 2 Feb 23 12:41 tom
Die Zeile
ForceCommand internal-sftp -d /%u
habe ich aus einem howto kopiert...
Hier mal ein Einwahlversuch aus einem Linux-Terminal:
sftp -v tom@10.0.0.4
OpenSSH_9.9p1 Ubuntu-3ubuntu3, OpenSSL 3.4.1 11 Feb 2025
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 10.0.0.4 [10.0.0.4] port 22.
debug1: Connection established.
debug1: identity file /home/tom-a/.ssh/id_rsa type -1
debug1: identity file /home/tom-a/.ssh/id_rsa-cert type -1
debug1: identity file /home/tom-a/.ssh/id_ecdsa type -1
debug1: identity file /home/tom-a/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/tom-a/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/tom-a/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/tom-a/.ssh/id_ed25519 type -1
debug1: identity file /home/tom-a/.ssh/id_ed25519-cert type -1
debug1: identity file /home/tom-a/.ssh/id_ed25519_sk type -1
debug1: identity file /home/tom-a/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/tom-a/.ssh/id_xmss type -1
debug1: identity file /home/tom-a/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.9p1 Ubuntu-3ubuntu3
debug1: Remote protocol version 2.0, remote software version OpenSSH_9.9p1 Ubuntu-3ubuntu3
debug1: compat_banner: match: OpenSSH_9.9p1 Ubuntu-3ubuntu3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.0.0.4:22 as 'tom'
debug1: load_hostkeys: fopen /home/tom-a/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: sntrup761x25519-sha512
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:XXX
debug1: load_hostkeys: fopen /home/tom-a/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '10.0.0.4' is known and matches the ED25519 host key.
debug1: Found key in /home/tom-a/.ssh/known_hosts:1
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: Sending SSH2_MSG_EXT_INFO
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=<0>
debug1: kex_ext_info_check_ver: ping@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Will attempt key: /home/tom-a/.ssh/id_rsa
debug1: Will attempt key: /home/tom-a/.ssh/id_ecdsa
debug1: Will attempt key: /home/tom-a/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/tom-a/.ssh/id_ed25519
debug1: Will attempt key: /home/tom-a/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/tom-a/.ssh/id_xmss
debug1: Trying private key: /home/tom-a/.ssh/id_rsa
debug1: Trying private key: /home/tom-a/.ssh/id_ecdsa
debug1: Trying private key: /home/tom-a/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/tom-a/.ssh/id_ed25519
debug1: Trying private key: /home/tom-a/.ssh/id_ed25519_sk
debug1: Trying private key: /home/tom-a/.ssh/id_xmss
debug1: Next authentication method: password
tom@10.0.0.4's password:
Authenticated to 10.0.0.4 ([10.0.0.4]:22) using "password".
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
Read from remote host 10.0.0.4: Connection reset by peer
client_loop: send disconnect: Broken pipe
Connection closed