6

I am using Laravel Forge in a DigitalOcean droplet. I need to grant SFTP access to a specific directory on the server to one of my clients. He needs read/write access to only that directory, and I am having problems with the setup.

I have followed the steps in https://bensmann.no/restrict-sftp-users-to-home-folder/, but I am stuck because Forge does not permit password authentication, only through public/private SSH keys...

Has someone done something similar? What would be the best approach for getting it done?

Many thanks in advance.

3
  • 1
    You could allow password authentication for everyone; but disable it for individual users. I.E. root and forge.
    – Ohgodwhy
    Nov 27, 2016 at 22:57
  • I do not know if it has any sense, but what if I only allowed password authentication for that specific SFTP user? Wouldn't it better? How could I achieve this?
    – andcl
    Nov 28, 2016 at 23:05
  • askubuntu.com/questions/101670/… just change the Match address to Match User and it should work
    – Justas S
    Apr 1, 2017 at 20:02

2 Answers 2

2

I know it's late, but it might help somebody in the future. I used Freek's post to set this up in Forge and although it seemed temperamental at first locking me out of SSH completely, it just started working after a few minutes.

4
  • @Zeth I have just checked it and it looks ok now - there must have been a temporary issue on their side. Jun 12, 2019 at 9:38
  • That's wierd. I just checked again now, - and it's still giving me an error: imgur.com/sQLI81Z ... I'm connecting from Denmark, Europe. Could i be some IP-block of non-US IP's or something?
    – Zeth
    Jun 12, 2019 at 11:22
  • Hmmm I can see that your URL is not exactly the match for mine: freek.dev/… But your error seems to rather be something to do with the .dev domain. I'm in the UK and it works just fine. You probably can't access the root domain either, can you? Have you tried other browsers? (I know that .dev is fairly new so it could also be a local domain routing/resolving/caching issue...) Jun 15, 2019 at 12:10
  • 2
    Could be something like that. I can't access it from either of my browsers (Safari, Chrome, Firefox). And you're right, - I can't access the root domain either: It says 502, Bad Gateway. I found another guide for the same thing (for others who can't access it): blog.laravel.com/forge-connect-to-your-server-using-ssh-or-sftp
    – Zeth
    Jun 16, 2019 at 15:29
0

You can do this using Filezilla as the sftp client. Get your SSH key, add it to forge in the SSH section, create the user account from the dropdown for the directory you wish to be isolated, then use filezilla to connect.

Generate SSH Public Key windows 10: https://phoenixnap.com/kb/generate-ssh-key-windows-10

To get your SSH key in the right .ppk format (use puttygen on a pc): https://filezillapro.com/docs/v3/basic-usage-instructions/ssh-private-keys-for-sftp/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.