what is correct way of adding a user in admin with role userAdminAnyDatabase doing upgrade to 2.6
IMPORTANT 
  The userAdminAnyDatabase user can grant itself and any other
  user full access to the entire MongoDB instance. The credentials to
  log in as this user should be carefully controlled.
  
  Users with the userAdmin and userAdminAnyDatabase privileges are not
  the same as the UNIX root superuser in that this role confers no
  additional access beyond user administration. These users cannot
  perform administrative operations or read or write data without first
  conferring themselves with additional permissions.


4 Steps for upgrading MongoDB v2.4 to v2.6


Ensure that at least one user exists in the admin database with the role userAdminAnyDatabase.
Upgrade client libraries,compatible with v2.6
Upgrade all MongoDB process to 2.6
Connect and authenticate to the mongod instance for a single deployment or a mongos for a sharded cluster as an admin database user with the role userAdminAnyDatabase.Use the authSchemaUpgrade command in the admin database to update the user data using the mongo shell.


See Also:

Upgrade MongoDB to 2.6
https://docs.mongodb.org/v2.6/release-notes/2.6-upgrade/

Create a User Administrator
https://docs.mongodb.org/v2.4/tutorial/add-user-administrator/