How to login on divshot cli inside a vagrant box? - authentication

Divshot has a nice command line interface. The first thing you should do after installing it with npm is to login.
divshot login
It should open a browser tab/window, you login on the divshot website and you authorise the CLI client by pressing a button at the end of the process.
But I have all my development environment on a vagrant box. When I type "divshot login" nothing happens. No browser tab appears.
What should I do?

Run "divshot login" from your command line on you local machine and
follow the instructions to login.
Run "divshot auth:token" to get
your auth token from the command line.
When running commands that
interact with the Divshot API, use the flag "--token " to
give it authorization (on the vagrant box)

Another solution:
Run divshot login on your local computer
Inspect $HOME/.divshot/config/user.json, check it has a key token
Copy that file to the corresponding path on the other computer

Related

I started FirewallD service but didn't allow SSH port, now I can't login my VM through SSH

I have a Centos VM on Google Cloud, I am using a custom SSH port and private SSH file to manage my VM.It worked fine for a long time but yesterday I started the "FirewallD" service in CentOS but I forgot to add a rule to allow my custom SSH port.
Now I can't connect to my VM through SSH, I also have tried to connect my VM through Web Console ("Open in browser window on custom port" and Open in browser window using provided private SSH key),neither of them works.
Are there any other solutions?
If you don’t have access through ssh at your vm, you could use the serial port to login
Go to the VM instances page in Google Cloud Platform console.
Click on the instance for which you want to add a startup script.
Click the Edit button at the top of the page.
Click on ‘Enable connecting to serial ports’
Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot.
Click on 'Connect to serial port' in the page.
If you don’t have a root password for the serial console, you could use a startup script to add it to your instance, the script would be like this:
Go to the VM instances page in Google Cloud Platform console.
Click on the instance for which you want to add a startup script.
Click the Edit button at the top of the page.
Click on ‘Enable connecting to serial ports’
Under Custom metadata, click Add item.
Set 'Key' to 'startup-script' and set 'Value' to this script:
#! /bin/bash
useradd -G <an existing group in the instance> USERNAME
echo USERNAME:PASSWORD | chpasswd
Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot.
Click on 'Connect to serial port' in the page.
In the new window, you might need to wait a bit and press on Enter of your keyboard once; then, you should see the login prompt.
Login using the USERNAME and PASSWORD you provided.
In this way you can login at the vm and stop the firewall service to modify your rules before to start the service again

Logon failed, use Ctrl + C to cancel basic credential prompt

I'm facing problems while trying to pull/push my code into a GitHub repository using the cmd prompt for the last two days. How can I resolve this issue?
Logon failed, use Ctrl + C to cancel basic credential prompt. Username for 'https://github.com': satyendrasingh8 Password for 'https://satyendrasingh8#github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/satyendrasingh8/chatApp.git/'
Fitz_Hoo is right! I just wanted to give a more detailed explanation that fix my issue. Essentially GitHub deprecated their password authentication recently (you can read more by clicking here).
Now instead of adding your username/email and password, you will login with your browser. The image below is the new interface. As Fitz_hoo mentions, you must update your Git to see the new changes!
If you are using Windows, you can simply use this command below to update your Git:
git update-git-for-windows
I fixed the problem just simply by upgrading my client Git Bash to the latest version!
When I encountered the problem, I received an email from a GitHub official, who told me the reason was mainly the Git version was incompatible:
GitHub has changed how users authenticate when using Git for Windows, and now requires the use of a web browser to authenticate to GitHub. To be able to login via web browser, users need to update to the latest version of Git for Windows. You can download the latest version at:
https://gitforwindows.org/
One reason for this message could be that the remote branch you were trying to pull was already deleted.
Delete the GitHub entry from Credential Manager: Control Panel → User Accounts → Credential Manager.
Then push the code again.
For me, the problem was that instead of my username I was trying to login with my email.
I received an email from GitHub telling me
We recently updated the format of our API authentication tokens,
providing additional security benefits to all our customers. In order
to benefit from this new format, please regenerate your personal
access token
I regenerated my personal access token (PAT) and was then unable to log in from command line on Windows 10 when I tried something like git pull.
A window would pop up, inviting me to enter 'username or email' and password. I tried various combinations, using the PAT, as mentioned in the GitHub documentation, and the actual password, but every time I received:
Logon failed, use ctrl+c to cancel basic credential prompt
Thanks to the answers from Fitz_Hoo and ousecTic, I updated my Git install with the command provided by ousecTic, and the authentication process was then completely different.
You can opt to use a PAT, but when you paste it in, no characters at all are shown, so just hit Enter.
In my case, I had this issue in relation to the federated authentication to AWS CodeCommit. The fix was to upgrade git to +v2.30.z (i.e. 2.35.3) and disable interactive prompt (docs):
git config --global credential.interactive false
A global configuration in ~/.gitconfig would look like:
[credential]
interactive = false
A AWS CodeCommit specific configuration, would look like (in ~/.gitconfig):
[credential "https://git-codecommit.us-east-1.amazonaws.com"]
interactive = false
here is the solution which works for me, uninstall Git from Machine after that install new version of it and sign in via web

Trac Login with --basic-auth

I need to use Trac for project management, but I am having problems with authentication. I don't have Apache, I'm using nginx and the tracd server.
To create the user, I used the command:
htpasswd -c /home/ubuntu/trac/projeto/.htpasswd usuario
To upload the service I'm using the following command:
/home/ubuntu/trac/virtualvenv/bin/tracd -p 3050 --basic-auth="/home/ubuntu/trac/projeto,/home/ubuntu/trac/projeto/.htpasswd," /home/ubuntu/trac/projeto
When I call the project in the browser, the login window is presented to me, which always fails, even informing the user and the correct password.
what am I doing wrong?
Try: --basic-auth="projeto,/home/ubuntu/trac/projeto/.htpasswd,trac". See TracStandalone for details.

Unable to login to the Jenkins application installed on my local machine

I want to configured Jenkins with selenium webdriver on my local machine. I have downloaded the jenkins.war file and successfully ran from CMD. But now it is asking me for username and password. Which username and password I need to provide?
Jenkins is initially configured to be secure on first launch. During the initial run of Jenkins a security token is generated and printed in the console log.
You can use admin as username and the token as a password, if you skipped the user-creation.
Go through the documents for more detail.
Jenkins Installation Document

Google compute engine ssh unavailable

I have restarted our google cloud compute engine instance, however after the restart ssh is no longer working and giving connection refused.
I have verified and the ssh keys are configured for the users, and firewall rules are open for ssh.
Is there any other method I can use to try and resolve this?
The first thing to do is to check the Serial console output of the machine to determine if the SSH daemon has started or not. That log can be accessed from the Developer Console.
If you couldn't ssh to the instance you can follow the below step to access the instance from the serial console:
Connect to the instance using the serial console
1. Go to the VM instances page in Google Cloud Platform console.
2. Click on the instance for which you want to add a startup script.
3. Click the Edit button at the top of the page.
4. Click on ‘Enable connecting to serial ports’
5. Under Custom metadata, click Add item.
6. Set 'Key' to 'startup-script' and set 'Value' to this script:
#! /bin/bash
useradd -G sudo USERNAME
echo 'USERNAME:PASSWORD' | chpasswd
7. Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot.
8. Click on 'Connect to serial port' in the page.
9. In the new window, you might need to wait a bit and press on Enter of your keyboard once; then, you should see the login prompt.
10. Login using the USERNAME and PASSWORD you provided.