You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI have installed the sftp with users, but the users are being created in the home directory, I need the users to be created in the directory that is on my PV storage so that it can be shared. I have also tried the sharing script that is available on the git page, but that does not seem to help. what is the best methos to allow multiple users to shar the same external directory easily.
The text was updated successfully, but these errors were encountered:
The bindmount script should allow you to do such. The bad part is that you must run with "privileged: true", disabling container isolation (ref. issue).
You can create a config map like this:
apiVersion: v1kind: ConfigMapmetadata:
name: sftp-mount-configdata:
bindmount.sh: |- #!/bin/bash # File mounted as: /etc/sftp.d/bindmount.sh # Just an example (make your own) function bindmount() { if [ -d "$1" ]; then mkdir -p "$2" fi mount --bind $3 "$1" "$2" } # Remember permissions, you may have to fix them: # chown -R :users /data/common bindmount /files/your_folder /home/user1/your_folder bindmount /files/your_folder /home/user2/your_folder # add as many users you want
And then deployment would look like this:
apiVersion: apps/v1kind: Deploymentmetadata:
name: sftp-serverlabels:
app: sftp-serverspec:
replicas: 1selector:
matchLabels:
app: sftp-servertemplate:
metadata:
labels:
app: sftp-serverspec:
volumes:
- name: sftp-data-volpersistentVolumeClaim:
claimName: pvc-data
- name: sftp-users-config-volumeconfigMap:
name: sftp-users-configitems:
- key: users.confpath: users.confdefaultMode: 420
- name: sftp-mount-config-volumeconfigMap:
name: sftp-mount-configitems:
- key: bindmount.shpath: bindmount.shdefaultMode: 493# Executable permissioncontainers:
- name: sftp-serverimage: atmoz/sftpports:
- containerPort: 22protocol: TCPresources: {}volumeMounts:
- name: sftp-users-config-volumemountPath: /etc/sftp/users.confsubPath: users.conf # Here I'm passing users as a configmap, you could also pass by args if I'm not mistaken
- name: sftp-mount-config-volumemountPath: /etc/sftp.d/bindmount.shsubPath: bindmount.sh
- name: sftp-data-volmountPath: /filessecurityContext:
privileged: true
HI have installed the sftp with users, but the users are being created in the home directory, I need the users to be created in the directory that is on my PV storage so that it can be shared. I have also tried the sharing script that is available on the git page, but that does not seem to help. what is the best methos to allow multiple users to shar the same external directory easily.
The text was updated successfully, but these errors were encountered: