How to reset identity file on Mac OS X Snow Leopard - github

Have not used Github for a while, and would like to reset my identity files on my computer (Mac) so that it can sync up with Github.
Followed the SSH instructions to append the Identity file and chmod to overwrite from Github, but still can't push my repository because Github won't make handshake and recognize the connection.
What is the quickest way to fix this problem?
Here are the results of the ls -l ~~/.ssh ; id command:
~ pdenlinger$ ls -l ~~/.ssh ; id
ls: ~~/.ssh: No such file or directory
uid=501(pdenlinger) gid=20(staff) groups=20(staff),403(com.apple.sharepoint.group.2),204(_developer),100(_lpoperator),98(_lpadmin),81(_appserveradm),80(admin),79(_appserverusr),61(localaccounts),12(everyone),402(com.apple.sharepoint.group.1),401(com.apple.access_screensharing)

Related

Window 10 connection of Github , SSH issues

I am trying to connect git to GitHub. I am using window 10.
The SSH directory is not available.
$ cd .ssh
bash: cd: .ssh: No such file or directory
How can I connect the git to github?
Screenhot of git to github ssh connection problem
Windows 10 systems with build 1803 or newer and Windows Server 2019 come with an implementation of OpenSSH that's enabled by default. Some older versions may have this as an optional component that needs to be installed before it can be used.
Looks like in your case it may need to be installed (see if the folder "C:\Windows\System32\OpenSSH" exists and has files such as "ssh.exe" in it). If it is installed, then that directory needs to be added to the search path (type "echo %PATH%" in the command prompt window to see if it's in there).
Installation
Click on the "Settings" gear in the left pane of the Start Menu.
Click on "Apps".
Click on "Optional features".
Look in the list. If you do not see "OpenSSH Client", click "Add a feature".
"OpenSSH Client" and click "Install".
On analyzing deeper into the issue, it looks like you are searching or trying to cd to .ssh on the desktop which won't work.
Additionally, it looks like you are doing cat to a file that may not have existed as you have never generated public-private key pair(See ssh-keygen command for details)
Just try typing ssh and press enter to see that if it is actually the problem with ssh.
It should give output as(or similar to) :-
$ ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user#]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
The .ssh directory is generally not available.
Not until you create it and use it with ssh-keygen (the one packaged with Git for Windows at C:\Program Files\Git\usr\bin\ssh-keygen.exe)
From a simple CMD:
cd %USERPROFILE%
mkdir .ssh
C:\Program Files\Git\usr\bin\ssh-keygen.exe -t rsa -P ""
You will get a:
%USERPROFILE%\.ssh\id_rsa (private key)
%USERPROFILE%\.ssh\id_rsa.pub (public key)
Copy the latter (the public key content) to your GitHub profile: that is how you associate Git to your GitHub account.
From there, you can open a Git bash session, and git clone using an SSH URL.
git clone git#github.com:me/myRepository

SourceTree Terminal prompting for password but repo authentication is done via SSH

I'm running into an issue where whenver I try to open the terminal for a repository in Sourcetree and I perform a command e.g. git push, I am prompted for a password. The weird thing is that the repository authentication is done via ssh. The normal controls in the GUI work fine for pulling/pushing and doesn't prompt me for a password.
I have set up SSH configuration like so (which works fine for the regular Sourcetree GUI):
As per this thread with a similar issue: https://community.atlassian.com/t5/Sourcetree-questions/ssh-key-in-sourcetree-terminal/qaq-p/137178 I have copied the privkey.ppk to C:\Users\Niels\.ssh\.
Pageant shows the private key as being added too:
Why can I not perform Git operations on my repository from the terminal?
Git uses different format for keys than pagent and pagent is only usable for SourceTree not for Git system. You have to generate a new ssh key with ssh-keygen and you have to add that key to git server you want to use. Open a terminal (GitBash) and apply the following steps:
cd ~/.ssh
ssh-keygen -t rsa -C "your.email#example.com" -b 4096
cat id_rsa.pub | clip
Last command would copy the new public key to the clipboard. You can add it to Git server just bye pasting in the mentioned text box.

Auto push to github without username and password

after much messing around I have followed this tutorial on using a cmd prompt to push up to git hub
http://readwrite.com/2013/10/02/github-for-beginners-part-2
However I have had to do a few things differently. Generating and adding the public key in GitHub went fine, however, adding the private key on my local machine has been a real pain.
I finally added it by opening a cmd prompt as administrator. then going to the directory where github was installed I then rand the following cmds to install the private key
bash
eval $(ssh-agent)
cd to-directory-where-private-.ssh-file-was-located
ssh-add .ssh
Identity added: .ssh (.ssh)
Prior to that I had numerous errors. However, when I run this from a batch file
cd c:/LocalDevelopment/PhoneGap/PfpMetrol
git init
git status
git add PhonegapData.js
git commit -m "Add PhonegapData.js"
git remote -v
git push
pause
it is still asking me for a username and password.

How to resolve cvs error: no such system user

I am trying to setup CVS on one our server ( let's call it JEDI). Then there is production server called DVADER.
I am able to log in from DVADER to JEDI using cvs login command with production user STWAR. However, as soon as I do cvs status I get following error :
Fatal error, aborting.
dsicnspr: no such system user
I have setup .passwd in CVSROOT folder for production user STWAR account on DVADER as shown below.
STWAR:hsfwfewiiu34de
However, there is no account of STWAR which is our production id on JEDI which is CVS server. So there is no entry of STWAR in /etc/passwd file on JEDI. I also tried using SystemAuth=no in config file inside CVSROOT but that is not working.
JEDI the CVS Server is also used for development and have other user account e.g. LIA who are able to login to JEDI.
Can anyone please tell me how to get rid of this error ? Do I need to setup account for STWAR
on JEDI and make an entry in /etc/passwd file ?
http://blog.jdknight.me/2015/03/how-to-setup-cvs-server-pserver-on.html
sudo chown -R :cvs /opt/cvsroot
sudo chmod -R g+ws /opt/cvsroot
(if you have selinux enforcing)
semanage fcontext -a -t cvs_data_t '/opt/cvsroot(/.*)?'
restorecon -R -v /opt/cvsroot
For example:
[root#*** ~]# ls -l /usr/local/repo/CVSROOT/passwd*
**-rw-rwSr--**. 1 root cvs 23 Nov 30 10:51 /usr/local/repo/CVSROOT/passwd -> no error
**-rw-r--r--**. 1 root cvs 1033 Dec 10 13:59 /usr/local/repo/CVSROOT/passwd.backup -> error as your questions above!

Capistrano error tar: This does not look like a tar archive

INFO [050fe961] Running mkdir -p /home/rails/rails-
capistrano/releases/20140114234157 on staging-rails
DEBUG [050fe961] Command: cd /home/rails/rails-capistrano/repo && ( PATH=/opt/ruby/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/rails/git-ssh.sh mkdir -p /home/rails/rails-capistrano/releases/20140114234157 )
INFO [050fe961] Finished in 0.142 seconds with exit status 0 (successful).
INFO [2dea2fe5] Running git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157 on staging-rails
DEBUG [2dea2fe5] Command: cd /home/rails/rails-capistrano/repo && ( PATH=/opt/ruby/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/rails/git-ssh.sh git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157 )
DEBUG [2dea2fe5] fatal: Not a valid object name
DEBUG [2dea2fe5] tar: This does not look like a tar archive
DEBUG [2dea2fe5] tar:
DEBUG [2dea2fe5] Exiting with failure status due to previous errors
I am confused about two things:
Why is Capistrano running git archive here:
git archive feature/Capistrano | tar -x -C /home/rails/rails-capistrano/releases/20140114234157
Why is tar failing?
I had the same issue, until I realized I was pulling the nonexistent branch from git.
Deleting app_name/repo also fixed this issue for me.
This happens when the repo in the server to deploy is messed up. We're talking about the bare git repo that Capistrano by default would put in /var/www/$application/repo (for other people's reference).
In your case it does not have a local feature/Capistrano branch so when running git archive feature/Capistrano nothing is output to that | pipe. To confirm, ssh into the server, cd into /home/rails/rails-capistrano/repo, and run git branch.
It's running git archive as a way to export the selected branch's tree. git archive "writes it out to the standard output" so Capistrano redirects that to tar in order to uncompress the archive immediately into your new release directory.
(Why Capistrano chose this instead of git checkout defeats me.)
tar fails because it's receiving nothing d:
I can think of two possible solutions/ways to troubleshoot:
ssh into the server and manually delete the repo folder (e.g. in your case /home/rails/rails-capistrano/repo) as mentioned by #lugolabs
make sure the server's repo is using the remote you're expecting (ssh in, cd into repo/, and run git remote -v) -- you may just need to update your :repo_url in deploy.rb (and delete the repo/ dir).
I think that folder gets populated via a git pull, so it shouldn't be empty. If you do see it empty the issue is from the git not the tarball.
The issue I had was my capistrano deploy.rb repository URL was set to a different one than that project i was working in. In order to fix this issue, I also had to logon to the server and delete the app_name/repo folder which must have been caching the original bad remote URL.
Whenever I have hit this error it was because the branch specified in my deploy/environment.rb file wasn't checked into git. Do an add / commit / git push origin branch_name and that will likely make things work.
You can set your branch on deploy.rb with:
set :branch, "main"
source
Note: the default branch is master
I'm using Bedrock Roots (wordpress) for development, capistrano for deploys and git flow.
Stumbled upon this error when tried to deploy, while on hotfix/x.x.x branch locally. So I finished current (merged changes to develop branch) and then successfully deployed.