Jump to content
Sign in to follow this  
Fankie

[PAMĀCĪBA] SFTP uz Linux

Recommended Posts

Sveiki,

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.
RHEL 7:

systemctl restart sshd


RHEL 6:

service sshd restart

#7 Pārbaudām

sftp lietotajs@IP vai hostname

 

 

  • Upvote 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.