Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows related users.conf problem #234

Closed
Prilipko opened this issue Aug 5, 2020 · 4 comments
Closed

Windows related users.conf problem #234

Prilipko opened this issue Aug 5, 2020 · 4 comments

Comments

@Prilipko
Copy link

Prilipko commented Aug 5, 2020

Hi! I also have problem with users.config when I tried to run command from readme

docker run -v C:\Users\MyUser\test\users.conf:/etc/sftp/users.conf:ro -v mySftpVolume:/home -p 2222:22 -d atmoz/sftp
I got an error in docker log and container is down

"/usr/local/bin/create-sftp-user] Parsing user data: "foo:123:1001:100

", do not match required regex pattern: [[:digit:]]* "100

/entrypoint: Error on line 60: create-sftp-user "$user"

It works on WSL but is there any way to run it on windows env

@LeonT-A
Copy link

LeonT-A commented Aug 5, 2020

I was never able to figure out my issue for getting the .conf file to work. Since I only need 2 users, what I ended up doing was passing the username and hashed password directly. Would still prefer to manage users in a separate file, but until then this at-least works.

    sftp_service:
        image: atmoz/sftp:alpine
        container_name: sftp_container
        restart: unless-stopped
        command: "username1:hashedpassword1:e:197609:197121 username2:hashedpassword2:e:197609:197121"
        ports:
            - '15100:22'
        volumes:
            --- snip --
            # - Host Keys -
            - ./docker/sftp/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key
            - ./docker/sftp/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key

@Prilipko
Copy link
Author

Prilipko commented Aug 6, 2020

Thanks @LeonT-A I found the solution. Probably you need to change CR LF line separators to only LF for all settings files

@Prilipko
Copy link
Author

Prilipko commented Aug 6, 2020

The problem is in different line separators in WIN and UNIX. It would be nice if server supports both types BTW

@Prilipko Prilipko closed this as completed Aug 6, 2020
@LeonT-A
Copy link

LeonT-A commented Aug 7, 2020

Thanks, I didn't even know this was a thing. It worked great.

For anyone else running into the regex issue with their users.conf file on windows, the article below shows you how to quickly change the hidden CRLF line separators to LF using Notepad++

Using Notepad++ to change end of line characters (CRLF to LF)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants