Environment variables

4 posts / 0 new
Last post
itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Environment variables

Hello,
Any environment variables listed are not taking effect: for example:

SET USER=username
SET LOGNAME=username
SET USERNAME=username
SET RSYNC_PASSWORD=password

none of these will be recognized when I do:

rsync -avP --stats --delete "/cygdrive/c/test_dir/" server.net:/testdir

I know I can do username@server.net:/testdir, but I want to know why this is not working via setting the environment variable

The rsync server will report back a user named "na" , and will still prompt for password. Why are the environment variables not being used?

Thanks

itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Re: Environment variables

What's your server platform ? How is rsync configured on that server ?

itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Re: Environment variables

It is windows 2003 server:
rsync.conf:

use chroot = false
strict modes = false
hosts allow = 192.168.1.2
log file = rsyncd.log
pid file = rsyncd.pid

# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#

path = /cygdrive/c/inetpub/rsync_storage
read only = false
transfer logging = yes

Thanks

itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Re: Environment variables

FAQ "How can I secure connections between windows rsync clients and cwRsync servers ? " may be relevant in your case. You can update the batch file generated by the wizard with your environment variables. At the server side, you have to use options auth users and secrets file :

From rsync configuration file documentation:

auth users
The "auth users" option specifies a comma and space-separated list of usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The usernames may also contain shell wildcard characters. If "auth users" is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames are passwords are stored in the file specified by the "secrets file" option. The default is for all users to be able to connect without a password (this is called "anonymous rsync").

See also the "CONNECTING TO AN RSYNC DAEMON OVER A REMOTE SHELL PROGRAM" section in rsync(1) for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.

secrets file
The "secrets file" option specifies the name of a file that contains the username:password pairs used for authenticating this module. This file is only consulted if the "auth users" option is specified. The file is line based and contains username:password pairs separated by a single colon. Any line starting with a hash (#) is considered a comment and is skipped. The passwords can contain any characters but be warned that many operating systems limit the length of passwords that can be typed at the client end, so you may find that passwords longer than 8 characters don't work.

There is no default for the "secrets file" option, you must choose a name (such as /etc/rsyncd.secrets). The file must normally not be readable by "other"; see "strict modes".

Topic locked

Release announcements