Score:0

SFTP on ubuntu 20.04

nr flag

I'm trying to set a sftp on my ubuntu 20.04, I have 2 users dev & prod and I want them to connect to folder /opt/tomcat/webapps/dev_project for dev & /opt/tomcat/webapps/prod_project for prod.

Both are in the group www-data, www-data is the owner of every projects in /opt/tomcat/webapps/

These ports are allowed with ufw

I changed ports in my sshd_config 50xx2 & 50xx3 (50xx2 for ssh & 50xx3 for sftp) and add this to the end of the file :

Subsystem sftp internal-sftp
Match User dev LocalPort 50xx3
        ChrootDirectory /opt/tomcat/webapps/dev_project/
        ForceCommand internal-sftp
        X11Forwarding no
        AllowTcpForwarding no
        PasswordAuthentication yes
Match User prod LocalPort 50xx3
        ChrootDirectory /opt/tomcat/webapps/prod_project/
        ForceCommand internal-sftp
        X11Forwarding no
        AllowTcpForwarding no
        PasswordAuthentication yes

Now I have 2 problems : I can connect dev or prod, but only with port 50xx2, but the chrootdirectory is / not that I set in the sshd_config file. If I try to connect to the 50xx3 port, I have a authentification error

Thanks for your advices

EDIT :

Well, now it's ok, I juste missunderstood user/group permissions on folders

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.