CentOS 7.4 SFTP 설정

Articles 2019/06/17 20:37 용비
1. sftp user creation
  • create the user
sudo adduser access
  • assign a password to the new user
sudo passwd access

2. Create Directory for File Transfer
  • create the directory for file upload
sudo mkdir -p /var/sftp/uploads
  • establish the root user as owner
sudo chown root:root /var/sftp
  • grant write permissions to the root user and read to the other users
sudo chmod 755 /var/sftp
  • modify the owner of uploads to be the user access
sudo chown access:access /var/sftp/uploads

3. Restrict Directory Access
  • restrict the access by the terminal to the user access
sudo vi /etc/ssh/sshd_config
  • In the final part of the file, add followings
Match User access

ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
  • Save the changes using the key combination
ESC + :wq
  • apply the changes in SSH
sudo systemctl restart sshd

4. Verify SSH Connection
  • SSH connection
ssh acces@{server_ip}
         ==> The result is verified that the connection will be closed through SSH
  • Use the sftp protocol
sftp access@{server_ip}










받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://www.yongbi.net/rss/response/847

트랙백 주소 :: http://www.yongbi.net/trackback/847

트랙백 RSS :: http://www.yongbi.net/rss/trackback/847

댓글을 달아 주세요

댓글 RSS 주소 : http://www.yongbi.net/rss/comment/847
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다