NetWorker: nsr commands fail when logged as root or Administrator command prompt.
Summary: nsr commands fail while logged as root, or when running nsr commands from an Administrator command prompt.
Symptoms
nsr commands fail while logged as root, or when running nsr commands from an Administrator command prompt.
nsr commands after logging in with nsrlogin works fine.
For example:
nsraddadmin -H <authc server> -P 9090
134747:nsraddadmin: Bad resource file.
nsraddadmin -H <NetWorker server> -P 9090
88924:nsraddadmin: Cannot connect to resource database: Unable to set user privileges based on user token for root on <NetWorker server>: Failed to validate security token.
root> nsraddadmin -u <user@NetWorker server>
nsraddadmin: Cannot connect to resource database: Unable to set user privileges based on user token for root on <NetWorker server>: Failed to validate security token.Cause
This can be caused by a user issuing nsrlogin previously without running nsrlogout. Stale tokens from the previous nsrlogin session are present in /nsr/tmp/sec/tokens on the NetWorker server.
Resolution
Run nsrlogout to clear the tokens. If there any tokens remain, either move the files from /nsr/tmp/sec/tokens to another directory (for example, /tmp) or delete the files.
Restarting the NetWorker server/services is not required.
After using nsrlogin for NetWorker tasks, run nsrlogout when you are done. When running NetWorker commands as root or from an Administrator prompt, nsrlogin is unnecessary.