I\'m trying to automate the setup of SFTP access. This script is running as a user with sudo permissions and no password.
I can create a user like so:
I guess the issue is that you forgot the -S option for sudo.