# Edit app files over SFTP with admin account

**URL:** <https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386>\
**Category:** Support apps\
**Tags:** english\
**Created:** [July 13, 2022, 5:24pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386 "2022-07-13T17:24:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![adel](https://forum.yunohost.org/user_avatar/forum.yunohost.org/adel/32/6240_2.png) [@adel](https://forum.yunohost.org/u/adel)\
**Post date:** [July 13, 2022, 5:24pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/1 "2022-07-13T17:24:48Z")

</div>

### My YunoHost server

**Hardware:** VPS bought online  
**YunoHost version:** 4.3.6.3  
**I have access to my server :** Through SSH  
**Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?** : no

### Description of my issue

Hi guys,

hope you’re doing well. In the past I used the `root` account to edit stuff using SFTP but I disabled it and use only the default `admin` user now. How am I supposed to work with files of the apps now? I see the admin doesn’t have many permissions and using sudo is not possible with e.g. FileZilla.

Is there a way to allow temporary permission and revert after doing changes?

Best regards

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 13, 2022, 9:26pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/2 "2022-07-13T21:26:29Z")

</div>

The answers is here: [Add permissions to admin to /var/www/\* using setfacl ? · Issue #1698 · YunoHost/issues · GitHub](https://github.com/YunoHost/issues/issues/1698#issuecomment-757396142)

---

<div class="post-metadata">

**Author:** ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)\
**Post date:** [July 14, 2022, 6:47pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/3 "2022-07-14T18:47:16Z")

</div>

I also wondered about that. Could you explain how this solution is supposed to work with, for example Filezilla? It is, unfortunately not obvious for me ☹

```auto
ssh admin@example.com -L 22:localhost:22
sftp root@localhost

```

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 14, 2022, 6:56pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/4 "2022-07-14T18:56:52Z")

</div>

Run the command in a console (or putty/mobaxterm)

```auto
ssh admin@example.com -L 22:localhost:22

```

Configure filezilla to connect on host: localhost, user:root and port: 22

The first command is a ssh tunnel, it’s like if you was inside your yunohost with filezilla. In this case you can connect with root.

---

<div class="post-metadata">

**Author:** ![TheNomad11](https://forum.yunohost.org/user_avatar/forum.yunohost.org/thenomad11/32/3139_2.png) [@TheNomad11](https://forum.yunohost.org/u/TheNomad11)\
**Post date:** [July 14, 2022, 7:20pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/5 "2022-07-14T19:20:19Z")

</div>

Ah, thanks a lot. I remember I tried ssh tunneling some time ago. I will have a try, thanks!

---

<div class="post-metadata">

**Author:** ![adel](https://forum.yunohost.org/user_avatar/forum.yunohost.org/adel/32/6240_2.png) [@adel](https://forum.yunohost.org/u/adel)\
**Post date:** [July 14, 2022, 7:47pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/6 "2022-07-14T19:47:48Z")

</div>

Thanks for clarifying! If my yunohost ssh is at port 1337, should I use `1337:localhost:22` or `22:localhost:1337`?

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 14, 2022, 7:49pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/7 "2022-07-14T19:49:53Z")

</div>

I never know, but you can do `1337:localhost:1337` and connect with filezilla on 1337

---

<div class="post-metadata">

**Author:** ![adel](https://forum.yunohost.org/user_avatar/forum.yunohost.org/adel/32/6240_2.png) [@adel](https://forum.yunohost.org/u/adel)\
**Post date:** [July 14, 2022, 8:02pm UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/8 "2022-07-14T20:02:09Z")

</div>

![Screenshot 2022-07-14 at 21.58.30](https://forum.yunohost.org/uploads/default/original/2X/3/36b409342fc4d07bb96db82fdfc7a43b3f0392f3.png)

I think I’ve setup the tunnel correctly. Didn’t show any errors after connecting using Terminal. Any idea why it’s asking for the public key? I use ssh keys for login but as far I understand that shouldn’t matter because I’m already logged in over Terminal. Orr… ?

---

<div class="post-metadata">

**Author:** ![Qprq](https://forum.yunohost.org/user_avatar/forum.yunohost.org/qprq/32/6217_2.png) [@Qprq](https://forum.yunohost.org/u/Qprq)\
**Post date:** [July 15, 2022, 12:41am UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/9 "2022-07-15T00:41:44Z")

</div>

> [@adel](#):
>
> If my yunohost ssh is at port 1337, should I use `1337:localhost:22` or `22:localhost:1337`?

Syntax is LOCALPORT:HOST:REMOTE PORT, but as stated by ljf, you can use anything as LOCALPORT (as long as this port is free).

> [@adel](#):
>
> I think I’ve setup the tunnel correctly. Didn’t show any errors after connecting using Terminal.

If there is a problem setting up the tunnel, a message should be displayed by ssh on the remote host (on the second line).

Anyway, I could not use SFTP in the way described by ljf, because root can’t connect to ssh on localhost on my yunohost instance with default config.

I works if:

1. There is an exception for root login from localhost
2. The local user connecting with sftp is in _/root/.ssh/authorized\_keys_

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [July 30, 2022, 12:41am UTC](https://forum.yunohost.org/t/edit-app-files-over-sftp-with-admin-account/20386/10 "2022-07-30T00:41:51Z")

</div>

Closed on July 30, 2022, 12:41am UTC

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
