Jump to content
Sign in to follow this  


Recommended Posts


Ja nu kādam interesē, kā ļoti ātri, viegli un bez papildus paku instalēšanas izveidot SFTP (Secure File Transfer Protocol) serveri.
Šis praktiski der jebkurai Linux OS, bet komandas var atšķirties.

#1 Papildinam sshd konfigurāciju.

vim /etc/ssh/sshd_config
Subsystem sftp internal-sftp

Match Group sftp
PasswordAuthentication yes
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no

#2. FTP lietotāju grupas izveide

groupadd sftp

#3. FTP lietotāja izveide

useradd -g sftp -s /bin/false lietotajs
passwd lietotajs

#4 FTP kataloga tiesību deliģēšana

chown root:root /home/lietotajs
chmod 755 /home/lietotajs 
mkdir /home/lietotajs/public 
chown lietotajs:sftp /home/lietotajs/*

#6. Restartējam sshd servisu.

systemctl restart sshd


service sshd restart

#7 Pārbaudām

sftp lietotajs@IP vai hostname



  • Upvote 2

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.