Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ./createdocker.sh newuser newpass
- USERNAME=$1 <-- thus USERNAME=newuser
- PASSWORD=$2 <-- thus PASSWORD=newpass
- /usr/bin/sshpass -p $ORIGINALPASSWORD ssh -p $PORT -o StrictHostKeyChecking=no root@$IP $SCRIPT
- SCRIPT="adduser $USERNAME; <-- add newuser
- echo -e $PASSWORDn$PASSWORD | (passwd --stdin $USERNAME); <-- set newpass
- echo ssh username: $USERNAME;
- echo ssh password: $PASSWORD;
- echo Instance Login Success;
- exit"
- [root@netunique docker-sshd]# ./signup_createdocker.sh newuser newpass
- Instance Created
- adduser newuser;echo -e newpassnnewpass | (passwd --stdin newuser);echo ssh username: newuser;echo ssh password: newpass;echo Instance Login Success;exit
- Warning: Permanently added '[localhost]:32936' (RSA) to the list of known hosts.
- Changing password for user newuser.
- passwd: all authentication tokens updated successfully. <-- appears 'set newpass' worked
- ssh username: newuser
- ssh password: newpass
- Instance Login Success
- [root@netunique docker-sshd]# ssh -p 32936 newuser@localhost
- myuser@localhost's password: <-- here I type 'newpass'
- Permission denied, please try again. <-- here the login fails
- myuser@localhost's password:
- adduser newuser
- echo -e "newpassnnewpass" | (passwd --stdin newuser)
Add Comment
Please, Sign In to add comment