Telegram- 👇 😉
-
. WIKIMERIONET
Merion Mertics , ,

CRM

3

, ! SFTP- Linux.

   SFTP   Linux

SFTP?

SFTP - - Secure SHell File Transfer Protocol. FTP, SSH. FTP , , SFTP .


SFTP- Linux

, sudo. SFTP , OpenSSH SSH- .

OpenSSH , :

sudo apt install openssh-server [Ubuntu/Debian]
sudo yum y install openssh-server openssh-clients [CentOS/RHEL]

SSH , SFTP.

sudo apt install ssh [Ubuntu/Debian]

SFTP.


1: , ,

SFTP, , .

sftpg, groupadd:

sudo groupadd sftpg

seenisftp, .

sudo useradd -g sftpg seenisftp 
sudo passwd seenisftp

useradd -g , .

, /data/ sftp, /data/USERNAME - . , sftp, /data/USERNAME. , uploads.

C :

sudo mkdir -p /data/seenisftp/upload
sudo chown -R root.sftpg /data/seenisftp
sudo chown -R seenisftp.sftpg /data/seenisftp/upload
: , /data/USERNAME root, SFTP

2: sshd_config

, , sftpg, , sftp , ssh. /etc/ssh/sshd_config:

Match Group sftpg
     ChrootDirectory /data/%u
     ForceCommand internal-sftp

ChrootDirectory (/ ) . . %u - escape m, .


3:

sshd_config , :

sudo systemctl restart sshd

SFTP Linux

SFTP SSH:

sftp seenisftp@merionet.ru

SFTP

SFTP:

COMMAND [SOURCE] [DESTINATION]

, .

  • GET - .
    GET poster.img ~/Pictures
  • PUT - .
    PUT ~/Pictures/picture2.jpg uploads/
  • RM .
    RM uploads/picture3.jpg