0

I'm trying to deploy atmoz sftp images for multiple users. I am new to this technology.

Below are the points I have tried.

  • I took the template from GitHub and deployed it on azure and with the help of the template I'm able to create the two users(users1 and users2).

  • For users1 I have created the folder1 and for user2 folder2 and I'm able to see the same structure while login into sftp.

  • For both the folders I have created the different file share.

My requirement is now to show both the folders to both the users but with user defined permission. users1 should have write permission on folder1 and read permission on folder2 and user2 should have write permission on folder2 and only read permission on folder1.

SFTP login for first user i.e user1 SFTP login second user i.e user2 Users page in container

sam
  • 131
  • 1
  • 5
  • 16
  • What you have tried for your purpose? What error do you get? – Charles Xu Sep 02 '20 at 07:33
  • @If you check the images you will see that I'm able to deploy SFTP with two users on same server one is having upload folder and another one is having download folder. Now I would want to have these two folders to be visible to both users but with read only permissions on download folder for user1 and read only permission on upload folder to user2. What I was trying further is updating directly "/home" folder and trying add the folders there but they're not working. – sam Sep 02 '20 at 07:54
  • How do you create the container instance? Can you share the command? And how does it look like inside the container for the users? – Charles Xu Sep 02 '20 at 08:53
  • @Charles I have used ARM template from the Github. Link for template is https://github.com/bhummerstone/azure-templates/blob/master/compute/sftp/sftp-existing-stg-multi-user.json. Container image for users attached – sam Sep 02 '20 at 09:12

1 Answers1

0

Currently, the Azure Container Instance does not support to change the permission when you mount the Azure File Share. And you can see all the users home path are owned by the root user and the root group:

enter image description here

And when you execute the command mount inside the container instance, you can see it like this:

enter image description here

Both file_mode and the dir_mode are set with the permission 0777. And there is no property to change the mount options in the ARM template. So I'm afraid you cannot achieve your purpose.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thank you @charles for your suggestion. I will dig more into it. Please let me know If any other solution suggestion which I can try as per the above requirement? – sam Sep 02 '20 at 10:03
  • @sam There is no solution for your requirement in ACI. Maybe you can use the VM directly so that you can control the mount permission. – Charles Xu Sep 03 '20 at 06:13
  • I was thinking of vm solution but in that the scalability will be the challenge. I was thinking to implement soln through Azure kubernetes service. – sam Sep 03 '20 at 16:55
  • @sam Yes, it's also a possible solution and worth a try. And if you do not mind and my answer is helpful to you, please accept it. – Charles Xu Sep 04 '20 at 01:08
  • This is off the topic. I'm trying to create YAML file for container group. I'm able to create one environment variable like environmentVariable: -name:var1 secureValue:var1. I'm trying to create multiple environmentVariable but YAML is not allowing. I know we can give multiple variable by name and secureValue combination but it's not working in the YAML file. Could you please suggest how can we give the multiple environmentVariables? – sam Sep 16 '20 at 13:14
  • @sam You can take a look at [here](https://learn.microsoft.com/en-us/azure/container-instances/container-instances-reference-yaml). – Charles Xu Sep 17 '20 at 06:53
  • I took the help from reference docs only. Everything is working fine the only issue is when I'm trying to give multiple env variables, It's not working. – sam Sep 17 '20 at 08:24
  • @sam Why not work? You need to use the `environmentVariables` in the YAML file to add the variables for the container. It works fine on my side. Do you really watch the link that I have provided you in the comment? – Charles Xu Sep 17 '20 at 08:38
  • yes I have gone through the link. In fact I took the help of the link at the time the single environment variable but with two or more environment variables is not working. The container and image is getting pulled but after few seconds images showing in terminated state in container group. – sam Sep 17 '20 at 09:12
  • @sam I guess there could be something wrong in your image, not multiple environment variables. In another hand, if you do not mind you can ask another question with more details so that I can test it for you to figure out what is the issue. – Charles Xu Sep 17 '20 at 09:16
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/221626/discussion-between-sam-and-charles-xu). – sam Sep 17 '20 at 09:19