954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Creating a Rsync GUI to Backup to a Remote Server

So I'm creating a backup GUI in Python which basically asks the user for their username/password and source directory so it can be rsynced over to a remote server. The only trouble I'm coming across is passing the password (entered in the GUI) to the server after I execute the command :

rsync -options source_path rsync_user@rsync_server:remote_path


Since I want the user to authenticate everytime they use the GUI I don't want to setup an automated ssh key session. I looked a bit into Pexpect and Paramiko but expect doesn't seem very secure and I wasn't sure how to configure Paramiko so I could rsync from the local computer to the remote server.

Basically I'm looking for a way to pass a password to the server (and trust the host) after the rsync command without any sort of terminal interaction (the purpose of the GUI).

kingdeslok
Newbie Poster
2 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

You would first have to encrypt the password, using whatever method your OS uses and then pass the encrypted password (unless it will be encrypted somewhere along the line), as only the very, very foolish store unencrypted passwords.

From the rsync man page
"Some paths on the remote server may require authentication.
If so then you will receive a password prompt when you connect.
You can avoid the password prompt by setting the environment variable
RSYNC_PASSWORD to the password you want to use or using the --password-file option.
This may be useful when scripting rsync."

There is also Grsync, but I have not used it.

woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
 

You would first have to encrypt the password, using whatever method your OS uses and then pass the encrypted password (unless it will be encrypted somewhere along the line), as only the very, very foolish store unencrypted passwords.

From the rsync man page "Some paths on the remote server may require authentication. If so then you will receive a password prompt when you connect. You can avoid the password prompt by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option. This may be useful when scripting rsync."

There is also Grsync, but I have not used it.

Yeah I've looked into the password-file option but I believe that it doesn't work for rsyncing via SSH but only through daemon.

kingdeslok
Newbie Poster
2 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: