Solana CLI: Use an other Phantom address - solana

I configured Solana CLI with a wallet address and now I want to change it.
I did the following steps in order to swap to the new Phantom address I want to use :
$ solana-keygen recover 'prompt:?key=6/0' --outfile ~/.config/solana/id.json
then I inserted my seed phrase and finally I got this output :
Recovered pubkey Bw...35h. Continue? (y/n): y
Wrote recovered keypair to ~/.config/solana/id.json
which is exactly the address I want to use ! But then when I check using solana address or solana-keygen pubkey I keep getting the old address :
solana-keygen pubkey
63...95x
solana address
63...95x
What am I missing ?

Simple solution:
solana config set -k ~/.config/solana/keypair.json
Edit

You can always check for Solana's current configuration using:
solana config get
After that check and make sure that the keypair your solana-cli is currently pointing to is actually the keypair you want in this case it might be pointing to the old keypair file
In order to change this use
solana config set --keypair <path_to_your_keypair>
For example
solana config set --keypair ~/.config/solana/id.json
I hope this helps!

Related

SSH Permission Denied and Different Fingerprint Generated in Terminal compared to in Gitlab SSH Key

Currently I am facing a problem with git clone a repo using SSH. I had set up my SSH Key and inserted it into GitLab. However still it does not work out.
Permission denied as like below:
And another problem is the fingerprint generated above is different from the one that is generated in Gitlab as shown below:
Hope if anyone could help. Had been troubleshooting this for a few days.
I tried to delete the .ssh folder and regenerate new key and did everything the same again but turn out to be the same, Permission denied and fingerprint is never matching.
I am using OpenSSH and OS: Windows 11 for this problem. I had also tried ssh -Tvvv <username#server> , ssh <username#server>, ssh -Tv <username#server> to verify whether if I am connected but the same permission denied.
As commented, the server fingerprint (for the ~/.ssh/known_hosts) differs from the public key fingerprint.
For the latter, test it with ssh -Tv git#gitlab.com, and check your private key is used.
If your private key does not have a default name (like id_rsa), you would need a ~/.ssh/config to reference your key.
Host gl
Hostname gitlab.com
User git
IdentityFile ~/.ssh/myKey
And ssh -Tv gl for testing.

RPC response error -32003: error when updating solana nft using metaboss

metaboss update uri -a 4KmoJffVvFHmNdnHbbjDaWaBTHSfNMqetZVjAVCGyJve-u https://arweave.net/XfP4jW_sF8msGJ5CWQ_ptmjlcYgumlpgKq__QrugU0c -k keypair.json.
keypair address is Em4dctbgQ2nkwRdbj7pdsL5hBVmMe6CoCnCucZvX5J9E
I have got the same error and solved with using Solana config command
solana config set --url https://api.devnet.solana.com
This will work well.

Unable to Clone CloudGoat from RhinoSecurityLabs

I am trying to install the Rhino Security Labs CloudGoat on my AWS Ubuntu 18.04 LTS Free-tier EC2 instance. I followed the directions for setting up an admin user and configuring the AWS CLI and also set up terraform v0.12 per the directions in the linked sites and the directions on GitHub. I also configured my instance's security group to allow All traffic.
However, when I run the git clone command I get "Permission denied" error. See below for full output:
sudo git clone git#github.com:RhinoSecurityLabs/cloudgoat.git ./CloudGoat
Cloning into './CloudGoat'...
The authenticity of host 'github.com (<ipv4>)' can't be established.
RSA key fingerprint is SHA256:<RSA key fingerprint>.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,<ipv4>' (RSA) to the list of known hosts.
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Do I need to associate an SSH key on GitHub to my account and if so how do I do that? I'm not sure what else to try at this point. Thanks.
This is because you don't have SSH Keys on EC2 that can authenticate your requests to Github. I encountered the same error when I was installing Cloudgoat on my personal machine (not EC2), and it worked when I setup my SSH keys (generate and add it to my git profile).
You will probably need to do the same with EC2 - Generate a key pair on EC2 and add the public key to your git profile.

Downloading existing key-pair (pem) file for ECS Instance Alibaba

I am working on a clients project and they have Magento installed on their EC2 instance, in order to ssh into it I need to have the pem file that was generated at the time of setting the key-pair. However I am not able to receive the pem file from their end and I am instead looking for a way to download the existing one. Is it even possible? Or do I create a new key-pair.
I wrote an article about Alibaba SSH Keypairs. If the keypair has been lost, you can replace it if you have Alibaba Cloud credentials (AccessKey and AccessKeySecret). This link to my article goes into specific details.
Alibaba Cloud SSH & ECS KeyPairs
The following commands require that the Alibaba Command Line CLI (aliyuncli) is installed and setup. I would backup (snapshot) the system before making the following changes.
This command will create a new Keypair called "NewKeyPair"
aliyuncli ecs CreateKeyPair --RegionId us-west-1 --KeyPairName NewKeyPair
This command will replace the current keypair with NewKeyPair (Windows syntax).
aliyuncli ecs AttachKeyPair --InstanceIds "[\"i-abcdeftvgllm854abcde\"]" --KeyPairName NewKeyPair
No, you can't download existing key. In order to connect to the server via ssh, you need the key which is generated at the time of server development. You can ask your clients for the key.

Adding Elastic IP causes shell login to fail

After associating Elastic IP on a Cloud server instance I cannot login anymore
ssh -i "ec2.pem" ubuntu#1.2.3.4
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is...
Please contact your system administrator.
How can I asssign a static IP (Elastic IP) with my EC2 Cloud server and still be able to login with the system / console?
This is merely a warning that you are connecting to a system that had a different SSH fingerprint, as stored in your local .ssh/known_hosts file. If you know things are okay, just delete the appropriate entry from that file and you can connect again.

Resources