M HYPE SPLASH
// updates

Invalid characters in linux password?

By John Peck

I am trying to automate creating linux users using bash

# Below password does NOT work
#USER_PASS="Eb*rx>BN?3x3SKd"
# Below password works!
USER_PASS="qwer1234"
# 2: Create sample user and set password
USER="sampleuser"
ssh root@$HOST "useradd -m $USER -s /bin/bash"
ssh root@$HOST "echo $USER:$USER_PASS | chpasswd"
ssh root@$HOST 'cat /etc/passwd'
echo "test ssh login with $USER"
sshpass -p $USER_PASS ssh $USER@$HOST

The above works fine when I use the 'qwer1234' password but does not work when I use the other one starting with 'Eb*'.

Are there any rules for linux passwords, characters etc.?

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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