Permissions Required for GIT-TF? - git-tf

I am the admin for my company's TFS2012 server. I have gotten GIT-TF working for myself, however the other developers at my company are having permission problems. They have access to the project in question as a contributor, but performing a clone of the project is yielding permission problems. Below is a snapshot of the cmd and error:
git-tf clone <servername> <projectname>
Connecting to TFS...
Username: <username>
Password:
Password:
Password:
git-tf: Access denied connecting to TFS server <servername> <authenticating as <username>>
When I perform the same command, it doesn't ask for my username and password, presumably because I am logged into Windows under a user with permission.
Thank you for any assistance.

Did you make sure to include the collection name in the url passed to the git-tf command? My company had problems exactly like you describe and that was the fix.
This: git-tf clone http://<server>:<port>/tfs/<collection name> $/<project name>
Not this: git-tf clone http://<server>:<port>/tfs/ $/<project name>
Hope this helps.

I had the same problem. Maybe they configured a proxy with the HTTP_PROXY environment variable, and your TFS server is local and the proxy should not be used to access it. It gave me the same symptom.

I had the same problem. Solution was:
1. Use https://github.com/new/import instead as described here.
2. Create and pass personal access token as described here.

Related

Managing multiple GIT ssh keys

Having some issues with maintaining too many SSH keys in the same computer lately.
I have created two SSH keys in my computer for UserA(Company) and UserB(Personal). Both the ID's are created using different email ID
I am able to pull and push the code changes for UserA
But UserB is where I face trouble to push my code.
I am able to pull the code for UserB(Where repo is different than UserA)
While pushing the code I get the following error
ERROR: Permission to UserB/xxxxxx.git denied to UserA.
Please make sure you have the correct access rights
and the repository exists. ```
Feel bit strange to me. Can someone help me this ?
Starting from Git 2.3.0 you can use below command
GIT_SSH_COMMAND='ssh -i private_key_file' git clone user#host:repo.git
Solved !!
Created Gitconfig for personal and work using the following link,
https://medium.com/#trionkidnapper/ssh-keys-with-multiple-github-accounts-c67db56f191e
Sometimes you have the problem of too many keys stored in the ssh-agent.
Then the server refuses the connection after it offering too many keys.
This can be solved by force ssh to use only one specific key.
GIT_SSH_COMMAND='ssh -o IdentityAgent=none -i private_key_file' git <cmd>

ActiveCollab - Forgot admin password - cannot reset through phpmyadmin

I am unable to reset the owner password for ActiveCollab v5.
Emails are not configured, so forgot password option is useless.
I have access to PHPMyAdmin, but am unable to reset the password.
Any help is appreciated.
Setting password directly in the database is not recommended. Instead, there's a command in ActiveCollab's command line utility that lets you set user's password. Navigate your terminal to a directory where ActiveCollab is installed and run:
php tasks/activecollab-cli.php user:set_password you#your-company.com
System will prompt you for a new password and set it.
If ActiveCollab's CLI tool complains that user:set_password command is not present, you are using an older version of ActiveCollab, and you should upgrade first. This can be done through command line as well. Here's the help article that goes into more details:
https://activecollab.com/help/books/self-hosted/upgrade

heroku pg:pull password authentication failed

I'm trying to run the heroku pg:pull command, but I can't seem to get the amazingly cryptic authentication process.
The command I'm running:
> heroku pg:pull app_name::RED localdb
I then get a password prompt, which I can't, for the life of me, figure out. After 2 guesses I get password authentication failed for user "Hanan", and that's it.
I tried Heroku's password, my Windows account password, every password I use, but nothing happens. I checked, and "Hanan" is not a role in Postgresql, so trying to change the password through psql doesn't work. I have no problem logging in to Postgresql through other roles, but it's this 'default' log-in process which I can't seem to crack.
Also, since I'm using windows, I'm not sure how to run commands like sudo -u postgres psql, which I see as a possible solution.
Will appreciate any help regarding this issue, I'm really frustrated by now...
Apparently it's possible to set the environment variables PGUSER and PGPASSWORD, as described here.
However, this won't work on windows in the given syntax. To do this on windows run the following:
SET PGUSER=[pg_username]
SET PGPASSWORD=[pg_password]
after entering these two lines Postgres will log you in with the given authentication info, instead of trying to sign in with the windows username
I've run into this problem a lot when running heroku pg:pull. The issue in my case was that the pg:pull command only works if my local PostgreSQL server has a password set.
To set a password, run psql localdb and execute this SQL:
ALTER USER my_user_name with password 'my_new_password';
(You won't necessarily be required to use this password all the time. Run psql localdb and see whether you're prompted; in my case, I can still log in to psql without the password.)
Now run heroku pg:pull --app my_heroku_app POSTGRESQL_COLOR localdb, and enter your new password (twice) when prompted.
I'm using Windows 10, 64-bit, Powershell and had to use the following commands to properly set the local PostgreSQL environment variables:
C:\> $Env:PGUSER="[pg_username]"
C:\> $Env:PGPASSWORD="[pg_password]"
To verify that these are set properly, list all local environment variables with this:
C:\> Get-ChildItem Env:
After doing this, I was able to run heroku pg:pull without being prompted for a password.
The previous answers did not work for me or were not to my liking so I kept searching. Thanks to the answer provided by Rayz on this post How to add a user to PostgreSQL in Windows? I was able to come up with this one liner for windows powershell.
& { $env:PGUSER="username";$env:PGPASSWORD="password"; heroku pg:push local-db DATABASE_URL --app heroku-app}
You apparently have to pass the variables as a list seperated by semicolons, surrounded by braces which are preceeded by an ampersand. Your funtion (heroku pg:pull/ pg:push/...) has to be a member of the list. As of my current testing it works in powershell with pg:push and the order of items within the braces does not matter.
I was too lazy to find out how to change credentials used by heroku. SET PGUSER and SET PASSWORD did not work for me, what i did was this:
Error said invalid credentials for "janbr" so i have created the user in the local db with a lot of priviledges. I used DBeaver for that with postgres credentials i have set up upon instalation of postgres.
Not a very clean solution though.
Using Windows 10, I tried all of the solutions here without any luck.
What ended up working for me was going into System Properties and editing my Environment Variables there. I added these to my System Variables, restarted my terminal and was able to run after that. One thing to note is that I first tried to add user and password to my User Variables but that didn't work.
PGUSER YourPostgresUser
PGPASSWORD YourPassword
I also ran Get-ChildItem Env: after updating my variables to check that they had been added.

Cache TFS login credentials for git-tf

I use git and git-tf at my job, but every time I perform any command with git-tf I have to enter my login credentials. Is there a way to cache my TFS login credentials for git-tf so I won't have to enter them every time?
If you use Kerberos and have a trust relationship with the Active Directory domain that your TFS server is on, you need not enter any password, git-tf will use your Kerberos ticket to authenticate. This, of course, will only work with on-premises servers; it will not work with Team Foundation Service.
To cache your username and password for the repository, you can set these in your .git/config:
git config git-tf.server.username myusername
git config git-tf.server.password mypassword
However, do note that this will store your password in plain text, which is why Kerberos is preferred. I am interested in adding support for the git credential storage mechanisms, but this does not yet exist.

Automatically setup jenkins users with CLI

I did not find any reference to user related commands for the jenkins-cli tool.
I need this to automate deployment.
Any comeback?
To use jenkins internal database simply use the following command.
echo 'jenkins.model.Jenkins.instance.securityRealm.createAccount("user1", "password123")' | \
java -jar jenkins-cli.jar -s http://localhost:8080/ groovy =
This will create user=user1 with password=password123
If you have any existing user and have restricted anonymous access to your jenkins, you can specify the username and password with
--username "user_name" and --password "password"
Maybe you don't want to use Jenkins' internal user database at all. There are a host of "Authentication and User Management" plugins.
If you like MySQL, there is a MySQL authenticator (it reads a table of users and passwords), and your "adduser" command could do an insert on that table.
If you like flat files, there is a "Script Security Realm", where you can authenticate with an arbitrary script. Write a file with user and password combos in your favorite format, write an "adduser" script that writes to it, and write an auth script that reads the file and determines whether to authenticate the user.
You can also hook up to an LDAP server, Active Directory, Atlassian Crowd, Unix user accounts (pw_auth), or whatever authentication your application server uses (if it's running off of a Tomcat server, for instance, you can tell Jenkins to let Tomcat authenticate users, and set up Tomcat to do it however you want.
If you specify in more detail what you are trying to do people here may help you better. That said, here are some pointers:
All CLI commands are available via http://[jenkins-server]/cli. What's not found there is not available via CLI. You can specify user name / password via --username and --password (or --password-file) options in CLI commands.
Another option for Jenkins automation is to use Python JenkinsAPI.
You can also use tools like wget and curl to perform certain actions (such as starting a build). There you may use user-specific tokens instead of username/password.
Here's another link that can be helpful.