Sftp-server: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
Zeile 4: Zeile 4:
 
root@ricky:~# groupadd sftponly
 
root@ricky:~# groupadd sftponly
 
root@ricky:~# useradd -G sftponly -d /users/anton -s /bin/false anton
 
root@ricky:~# useradd -G sftponly -d /users/anton -s /bin/false anton
root@ricky:~# mkdir -p /home/anton/ablage
+
root@ricky:~# mkdir -p /users/anton/ablage
root@ricky:~# chown anton /home/anton/ablage
+
root@ricky:~# chown anton /users/anton/ablage
 
</source>
 
</source>
  

Version vom 2. Oktober 2018, 13:59 Uhr

User und Home-Dir anlegen

root@ricky:~# mkdir /users/
root@ricky:~# groupadd sftponly
root@ricky:~# useradd -G sftponly -d /users/anton -s /bin/false anton
root@ricky:~# mkdir -p /users/anton/ablage
root@ricky:~# chown anton /users/anton/ablage

config

  • /etc/ssh/sshd.conf
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
Match Group sftponly
        ChrootDirectory /users/%u
        ForceCommand internal-sftp
        AllowTcpForwarding no

Links