Help

2

How to authenticate user while taking database backup using XMLRPC?

Hello Everyone,

I have sample script which take dump backup using XMLRPC, This script works well with intra-network(Internal network), but having Access denied Error while applying on inter-network.

Here is my script

------------------------

 
import base64 import xmlrpclib sock = xmlrpclib.ServerProxy('http://serverip:8888/xmlrpc/db') #Real public IP all_database = sock.list() for database in all_database: file_path = "/home/serpentcs/backup/" #Give path of folder where backup file will be store file_path += database file_path += ".dump" backup_db_file = open(file_path, 'wb') backup_db_file.write(base64.b64decode(sock.dump('admin', database))) #admin is master password in my case backup_db_file.close()

------------------------

Does anybody has idea about this? help will be appreciated.

Thanks & Regards,

Anil.


1 Comment
Avatar
Discard
Avatar
Chandni Gandhi
-

Hi Anil,

Have you solved this?

2 Answers
2
Best Answer

Hey,

Try "Port Forwarding" on client server. 192.168.1.13 - is your private IP address on the LAN. That might be a case of IP change. 

contact your system admin and tell them to forward port. 

Very good article with pictures is here: How to Forward Ports on Your Router.

2 Comments
Avatar
Discard

You don't understand my question, I don't have problem with IP address, in example i have just added dummy IP, using that example with Public IP have authentication problem.

@Openies : Thanks for the best link of IP forwarding, In I am using the Public IP, for the security reason I can not display on example that why I have just add sample IP. Just try this script with your any of your live server and see what is the problem I am facing.

1
Avatar
Solanki Shamji
Best Answer

Hello Anil,

I think problem is due to private IP. Private IP is only access within local area network. 

So try after make your IP as public IP. 

May be this will helpful you.

Thanks.

Shamji.



3 Comments
Avatar
Discard

@Shyam : The IP I am using for execute this script is already public static IP. its need some authentication to access that system. Which is accessible via inter network world from browser.

Avatar
Solanki Shamji
-

Its not public. I cant access.

@shyam: I appreciate your answer, But I don't have any problem regarding IP address. You don't understand my question properly. Read twice and think.