# SFTP external storage connects with RSA but is unable to write

**URL:** <https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554>\
**Category:** ℹ️ Support\
**Tags:** external\_storage, github\_issue\_required, nc20, sftp, encryption-server\
**Created:** [May 5, 2021, 1:29pm UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554 "2021-05-05T13:29:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![giou](https://help.nextcloud.com/letter_avatar/giou/32/5_5575768a8748004e209b776fc1b2916d.png) [@giou](https://help.nextcloud.com/u/giou)\
**Post date:** [May 5, 2021, 1:29pm UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/1 "2021-05-05T13:29:42Z")

</div>

Nextcloud version : `20.0.9.1`  
Operating system and version: `Ubuntu 20.04`  
Apache or nginx version _(eg, Apache 2.4.25)_: `nginx 1.18 `  
PHP version _(eg, 7.4)_: `7.4.3`

The issue you are facing:  
**SFTP external storage connects with RSA but is unable to write**  
When connecting using alternative private key in FileZilla has the expected behavior.

Is this the first time you’ve seen this error? _(Y/N)_: Y

Steps to replicate it:

1. Add External storage SFTP with RSA Key auth
2. Copy ssh-rsa public key to .ssh/authorized\_keys
3. Open External storage folder in nextcloud

The output of your Nextcloud log in **Admin \> Logging** :

```auto
{"reqId":"nkzCZfkJeoP3ihYWwMgQ","level":4,"time":"2021-05-05T13:21:47+00:00","remoteAddr":"IP.ADD","user":"USER","app":"webdav","method":"PUT","url":"/remote.php/webdav/1326/padlocked.jpg","message":{"Exception":"Sabre\\DAV\\Exception","Message":"Could not rename part file to final file","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1104,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":527,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":84,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":296,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0","version":"20.0.9.1","id":"60929bf14e8d7"}

```

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'instanceid' => 'A',
  'passwordsalt' => 'A',
  'secret' => 'A',
  'trusted_domains' => 
  array (
    0 => 'A',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.9.1',
  'overwrite.cli.url' => 'A',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'A',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'A',
  'mail_from_address' => 'A',
  'mail_domain' => 'A',
  'mail_smtpport' => '587',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'A',
  'mail_smtppassword' => 'A',
);

```

---

<div class="post-metadata">

**Author:** ![giou](https://help.nextcloud.com/letter_avatar/giou/32/5_5575768a8748004e209b776fc1b2916d.png) [@giou](https://help.nextcloud.com/u/giou)\
**Post date:** [May 6, 2021, 4:46pm UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/2 "2021-05-06T16:46:18Z")

</div>

I managed to create a folder from webdav but not upload files

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [May 8, 2021, 11:56am UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/3 "2021-05-08T11:56:20Z")

</div>

> [@giou](#):
>
> SFTP external storage connects with RSA but is unable to write

Can you read from it?  
Any logs and information from the sftp storage (in case it is yours)?

---

<div class="post-metadata">

**Author:** ![giou](https://help.nextcloud.com/letter_avatar/giou/32/5_5575768a8748004e209b776fc1b2916d.png) [@giou](https://help.nextcloud.com/u/giou)\
**Post date:** [May 9, 2021, 9:47pm UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/4 "2021-05-09T21:47:40Z")

</div>

Yes I see the default linux user files but can’t write, only create folders through Linux nextcloud account

 ![Screenshot from 2021-05-09 23-43-06](https://help.nextcloud.com/uploads/default/original/3X/c/6/c6744369e8257aaa0d0a93e5492927b24c43a7d5.png)  
 ![Screenshot from 2021-05-09 23-45-05](https://help.nextcloud.com/uploads/default/original/3X/b/a/ba6d40c1ecd97998091fdb30b7a8af310377776b.jpeg)

I don’t have any logs

---

<div class="post-metadata">

**Author:** ![giou](https://help.nextcloud.com/letter_avatar/giou/32/5_5575768a8748004e209b776fc1b2916d.png) [@giou](https://help.nextcloud.com/u/giou)\
**Post date:** [May 13, 2021, 8:05pm UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/5 "2021-05-13T20:05:21Z")

</div>

I made a fresh installation with the latest version and can confirm that this is a **bug with the default encryption module**

In the fresh install I can connect to the external server and write files until I enable the default encryption module. Then it has the behavior described above.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [May 14, 2021, 8:06am UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/6 "2021-05-14T08:06:40Z")

</div>

Then it is something for the bug tracker: [Issues · nextcloud/server · GitHub](https://github.com/nextcloud/server/issues)

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 9:31am UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/7 "2024-12-13T09:31:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 9:31am UTC](https://help.nextcloud.com/t/sftp-external-storage-connects-with-rsa-but-is-unable-to-write/115554/8 "2024-12-13T09:31:30Z")

</div>


