I was wondering if there would be any issue with placing a single quote in a ubuntu user's password. We have a couple machines with a dummy user for automation purposes and I would like the password to be the same across all platforms (not the best for security I'm aware). Would a single quote be treated as a string literal even when setting a password or is setting a password treated as input for dev/tty and not stdin in this case so the escaping wouldn't occur?

  • @archemar provided the correct answer. I just needed a password for a new user on a ubuntu box. That password had to have a single quote in it. I just wanted someone to confirm my possible suspicions before screwing something up Dec 13, 2018 at 13:34

1 Answer 1


there should be no problem in interactive mode (on the tty).

If you want to set it by script, you may need to escape it, or use other quote (e.g "Pass'word" or 'Pass"word' ).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.