framework: the privateKey could not use on SFTP
- Laravel Version: 5.7.17
- PHP Version: 7.2.12
- Database Driver & Version: Mysql 5.7.24
Description:
the privateKey could not use on SFTP, but password can do
Steps To Reproduce:
config/filesystems.php
'main_dir' => [
'driver' => 'sftp',
'host' => '***',
'username' => 'root',
'privateKey' => '/var/id_rsa', // file permissions was ok
'password' => '*****',
],
that could not login… but use sftp root@**** -i/var/id_rsa
ok
but use password could login…
'main_dir' => [
'driver' => 'sftp',
'host' => '***',
'username' => 'root',
//'privateKey' => '/var/id_rsa', // file permissions was ok
'password' => '*****',
],
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (10 by maintainers)
I use it this way:
When i use with password it doesn’t work for me. Also i couldn’t get the privateKey file reference to work so i use the contents of it directly (i think this is also a tiny bit more performant).
I also suggest you use the cache option so the server doesn’t have to re-auth every time you call the disk.
composer require league/flysystem-cached-adapter
…The key was wrong…That my mistakes… I change an other key…That worded…Sorry for wasting your time… Thanks for your help…