Linux sftpd

From Ever changing code
Jump to navigation Jump to search

This is just draft....

sftp user1@server.com -oIdentityFile=/path/to/private/keyfile


Snipped below shows usage of custom auth keys, allow for public, then password authentication. The user1 authorisation key file will be in the USER_HOME/.ssh/authorised_keys the other user user2 will use custom path to the authorised keys file.

Subsystem sftp internal-sftp  #can take something like -l INFO and more for logging
Match User user1
    ChrootDirectory /sftp/user1
    AllowTCPForwarding no
    X11Forwarding no
    ForceCommand internal-sftp -u 2
    PasswordAuthentication yes
Match User user2
    ChrootDirectory /sftp/user2
    AuthorizedKeysFile /sftp/user2/.ssh_user2/authorized_keys   #both authorised keys and .ssh_user2 need to be owned by user2
    AllowTCPForwarding no
    X11Forwarding no
    ForceCommand internal-sftp -u 2
    PasswordAuthentication yes