bash script remote user EASY ( 5 stars )
Project detail
Hello – please see my script below – need this to create a user on the remote host (ubuntu raspberry pi) – this should be a key enabled user, the name is myansible as you can see…- the script should be able to run the last 3 lines successfully after the above script with your input (OPEN TO YOUR SUGGESTIONS AND CORRECTIONS)
#!/bin/bash
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ]
then
echo ” ”
echo ‘SYNTAX ./set-remote-user.sh ‘
echo “this is to create keys and make passwords unusable”
exit 100
fi
echo “ipaddresss………..$1”
echo “username………….$2”
echo “password………….$3″
#
set -x
ssh-keygen -q -t rsa -N ” -f ~/.ssh/tmp-pi-key <</dev/null 2>&1
sshpass -p x ssh-copy-id -i ~/.ssh/tmp-pi-key.pub pi@192.168.1.152
ls -la ~/.ssh | grep tmp
#scp -i ~/.ssh/tmp-pi-key make-user.sh $2@$1:~
ssh $2@$1 “sudo ls -l /home”
ssh $2@$1 “sudo userdel myansible && sudo rm -Rf /home/myansible/”
ssh $2@$1 “sudo -S useradd myansible -m -s /bin/bash”
ssh $2@$1 “sudo cat /etc/passwd | grep myansible”
ssh $2@$1 “sudo mkdir -vp /home/myansible/.ssh”
ssh $2@$1 “sudo ls -l /home/myansible”
ssh $2@$1 “sudo ls -l /home/myansible/.ssh”
ssh $2@$1 “sudo chown -R myansible:myansible /home/myansible”
ssh -i ~/.ssh/tmp-pi-key myansible@$1 “pwd”
ssh -i ~/.ssh/tmp-pi-key myansible@$1 “ls -latr”
ssh -i ~/.ssh/tmp-pi-key myansible@$1 “pwd”
There is hope you can give your “best” price; unemployed, and have cancer with bills backing up, $12 possible? Glowing paragraph of feedback 5 stars
My funds are low but will pay quick and leave 5 stars. Please give your best possible for your bid ? (something reasonable?) Please note there is hope we can mutually complete this task; we can leave each other nice comments and 5 stars for each? Look at feedback on my profile, feedback I left for many others. Here is the project:
SINCERELY WOULD BE NICE TO MEET YOU PLEASE
ANY THOUGHTS ? Please note project is due in two hours as this projects deadline, as this is needed if we can get some done – then we can talk about next steps and 5 stars and another job also. If this is a good one and we are “successful”; would need a couple others setup, but will handle one at a time? Can you do this for something reasonable in a couple hours? thoughts ?