0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

create a sftp server on linux (with laravel connection example)

Posted at

Creating an SFTP Group and User

apt update
addgroup sftp_fosslinux
useradd -m sftpfossuser -g sftp_fosslinux
passwd sftpfossuser
chmod 700 /home/sftpfossuser/

Installing SSH Daemon

apt install -y ssh
echo "Match group sftp_fosslinux 
ChrootDirectory /home 
X11Forwarding no 
AllowTcpForwarding no 
ForceCommand internal-sftp" >> /etc/ssh/sshd_config
systemctl restart ssh

OpenSSHをインストール

apt install -y openssh-server
service ssh start

試し

sftp sftpfossuser@127.0.0.1

Laravel

# config/filesystems.php

'sftp-test' => [
            'driver' => 'sftp',
            'host'   => '127.0.0.1',
            'username' => 'sftpfossuser',
            'password' => 'sftpfossuser',
            'visibility' => 'public',
            'permPublic' => 0766,
            'root' => '/sftpfossuser'
        ],
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?