P
P
Puma Thailand2012-11-27 09:22:03
CVS
Puma Thailand, 2012-11-27 09:22:03

Why doesn't automatic authorization work in svn when started from cron

A simple creak is performed on the server from time to time
cd /svn
svn up

The password and login were saved at the first checkout.
The repository is located on the same server and works via mod_dav_svn in apache
When you run it in the console, everything goes fine, when from the cron

Authentication realm: < svnip :80> Authorization Realm
Password for 'root': Authentication realm: < svnip :80> Authorization Realm
Username : svn: OPTIONS of 'http://[email protected]/vpn': authorization failed: Could not authenticate to server: rejected Basic challenge (http://svnip

)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lev Lybin, 2012-11-27
@lybin

Because cron runs under another user, under which he does not know the authorization parameters, such as this)

I
Igor Fatkulin, 2012-11-27
@ingiboy

enter the login and password in the command line parameters, and set the access rights to the script so that no one else will read it

D
DmZ, 2012-11-27
@DmZ

The password and login were saved at the first checkout.

Password for 'root':

1. Is the cron task exactly run as the same user under which the creds were saved?
2. Try explicitly setting the following parameters in the configuration:
~/.subversion/config:
store-passwords = yes
store-auth-creds = yes

~/.subversion/server:
store-plaintext-passwords = yes
store-passwords = yes
store-auth-creds = yes

3. svn likes to delete saved kreds if for some reason authorization failed (up to a slow server response) - I encountered this behavior regularly at one time due to the heavy load on the svn server. The way out is to explicitly register the creds in the command line svn --username=xxx --password=yyy up
This will not practically reduce the security, since the password is still in the plaintext in ~/.subversion/auth/*, but it will protect against misbehavior. (You can run U=xxx P=yyy svn --username=$U --password=$P up so that passwords don't glow on ps ax)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question