Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Mounting an Oracle Cloud Object Storage Bucket as a File System on Linux

                                       

Mounting an Oracle Cloud Object Storage Bucket as a File System on Linux

 

Prerequisites:
Ensure that bucket you’re trying to mount is in the compartment listed for S3 compatibility; by default, it’s a root compartment of the tenancy.

If you need to change that, settings are located under Administration->Tenancy Details->Edit Object Storage Setting.
 
Create an Object Storage Bucket from the OCI Console.
Click in Object Storage
Enter a name for the bucket and click on Create Bucket.
Install s3fs-fuse
You can install s3fs-fuse by using a prebuilt package from the Oracle Linux EPEL repository. In this post, I’m using the binary RPM.
Configure Credentials
 
In the Oracle Cloud Infrastructure Console, click the Profile icon in the top-right corner, and select User Settings.
 
Click Customer Secret Keys, and then click Generate Secret Key.
 
Give the key a meaningful name (for example, bk_orap2g), and then click Generate Secret Key
 
Copy and save the secret key because it won’t be shown again.
 
The S3 credentials are created by using an access key and the secret key. The access key is displayed in the Customer Secret Keys area of the Console.

Generate Secret Key: bk_orap2g

Generated Key: xxxxxxxxxxxxN5ujFRYICdG5RQbiuyxi07+PWrLdE=
Access key: cc3e970b898676154xxxxxxxxxxxxxxxxxxxxxxxx


Create the directory and assign ownership

 
# mkdir /home/oracle/bkp_db
# chown oracle:oinstall /home/oracle/bkp_db


Mount the File System

 
$ s3fs bucket2fs /home/oracle/bkp_db -o passwd_file==${HOME}/.password-bk -o url=https://mynamespace.compat.objectstorage..oraclecloud.com/ -o nomultipart -o use_path_request_style


Add an entry in the /etc/fstab file.

#s3fs
bk_orap2g /home/oracle/bkp_db fuse.s3fs _netdev,allow_other,nomultipart,use_path_request_style,passwd_file=/home/oracle/.passwd-bk,url=https://mynamespace.bej2.objectstorage.eu-frankfurt-1.oraclecloud.com/ 0 0

or add an entry to crontab to mount bucket on reboot.

@reboot s3fs bucket2fs /home/oracle/bkp_db -o passwd_file==${HOME}/.password-bk -o url=https://mynamespace.compat.objectstorage..oraclecloud.com/ -o nomultipart -o use_path_request_style




If you get the following error, change the permission of /usr/bin/fusermount:

fuse: failed to exec fusermount: Permission denied

[oracle@ora2pg ~]$ ls -l /usr/bin/fusermount
-rwsr-x---. 1 root fuse 32584 Fev 25 2021 /usr/bin/fusermount

Run the following command, and then try again:

[oracle@ora2pg ~]# sudo chmod +x /usr/bin/fusermount
[oracle@ora2pg ~]$ ls -l /usr/bin/fusermount
-rwsr-x–x. 1 root fuse 32584 Fev 25 2021 /usr/bin/fusermount

If there’s an issue, add the Debug parameter to help troubleshoot:

[oracle@ora2pg ~]$ s3fs bucket-1 /test_bucket -o passwd_file=${HOME}/.passwd-s3fs -o dbglevel=info -f -o curldbg=


 



Steps to reset the opc account SSH Key

 

 The official documentation  https://docs.cloud.oracle.com/iaas/Content/Compute/References/serialconsole.htm 

Create the Console Connection -

  1. Login as an Administrator to the OCI console
  2. Navigate to Compute > Instances > then select your instance
  3. On the bottom left select Console Connections
  4. From a terminal run “cat ~/.ssh/id_rsa.pub” and copy it. If you have another public key you want to use, feel free to use it.
  5. Click on Create Console Connection
  6. Select the PASTE SSH KEYS option
  7. Paste the ssh public key into the field
  8. Click on the Create Console Connection button.
  9. Once it is Active select the three dots menu on the right and select Connect with SSH, alternately you could use Connect with VNC.
  10. Choose LINUX/MAC OS or WINDOWS and copy the command.
  11. In a text editor to make it easier and for insurance modify the command and add “-i ~/.ssh/id_rsa” in a couple places; replace id_rsa with your private key if it is different.  For example the changes in red:

ssh -i ~/.ssh/id_rsa -o ProxyCommand='ssh -W %h:%p -i ~/.ssh/id_rsa -p 443 ocid1.instanceconsoleconnection.oc1.iad.abuwcljtb73kpfekbhmaf6j7qa56uorzbqtnej4jgviliiofkgfimgi5d3yq@instance-console.us-ashburn-1.oraclecloud.com' ocid1.instance.oc1.iad.abuwcljtjpcpb3ztejz7r5vaap3cpaznuryrdz6yhv3mejxhvalnd7e3ddoa

Access the instance via the Serial Console –

  1. From the previous steps paste the command that was copied and modified into a new terminal window and press enter.
  2. Press enter again and you should now see a prompt to login — DO NOT LOGIN.
  3. While watching your terminal with the login prompt, in the OCI console click on the Reboot button of your instance > choose confirm OK.  
  4. You should see commands running across the terminal and once you see the OS options immediately use your up and down arrows to change the option. If you wait to long it will default to an option and continue to start. If that happens you will have to reboot again.
  5. For Linux select the Unbreakable Enterprise Kernel option and press “e” to edit. 
  6. This is the tricky part.  Scroll down using your keyboard down arrow to the very bottom.  You should see the cursor in a lighter color; it can be hard to see, but trust me it is there.  
  7. Move the cursor until it is between the loglevel=4 and the last line ending in “initrdefi /boot/xxxxx.x86_64.img”.
  8. Insert “rw init=/bin/bash”, be sure there is a space between the two other lines (see below).
  9. Now press CTRL-X and it will reboot to a bash shell as root --- *** BE CAREFUL NOW ***.

 

Reset the OPC SSH key –

From the same terminal from the previous steps run the following:

  1. Execute "/usr/sbin/load_policy -i” - to preserve the SELinux policies for the files you will modify.
  2. Execute "/bin/mount -o remount,rw /“ - to remount the root partition with read/write permissions.
  3. Execute "cd ~opc/.ssh” - to change to the opc SSH key directory. If you run a ls command you should see one file authorized_keys. If you run “cat authorized_keys” it may be empty or the wrong key; mine was empty.
  4. Execute “mv authorized_keys authorized_keys.orig” - as a safety precaution to back up the original file.
  5. Execute “vi authorized_keys” - to create a new authorized_keys file.
  6. Press “i” to insert some text.
  7. Paste in your ssh public key used from the previous step when you created the console connection.
  8. Press ESC, enter “:wq”, and press Enter to write and quit the file to save it.
  9. Execute “chown opc:opc authorized_keys” to make sure the owner of the file is opc otherwise it will be owned by root.
  10. Execute “chmod 600 authorized_keys” to set the proper permissions.
  11. Execute "mount -o remount,ro /” to force the OS to flush the filesystem cache. It also guarantees that the filesystem is marked as "cleanly unmounted" when the machine comes back up from a reboot.
  12. Execute “/usr/sbin/reboot -f” to reboot the running instance. 
  13. Next when you see the same OS options let the server start using the default OS option.
  14. After the instance has rebooted open a new terminal and try to ssh in using “ssh opc@myinstance”; change myinstance to your hostname.  Another alternative is to provide the location to your private key like “ssh -i ~/.ssh/my_private_key opc@myinstance”.  
  15. If successful you will get a login prompt; yeah!

Important, I recommend closing the terminal window with the serial connection and then deleting the Console Connection immediately using the OCI console. If you don't delete the serial console it will terminate your session automatically after 24 hours and you will have to re-authenticate, but the serial console will still be there. The risk is low since for someone to use this serial console they would need your private key, but as a precautionary measure it is best to delete the serial console as soon as you are finished using it.  

REMOVE OEM 12C AGENT MANUALY


OEM 12c has a very useful Perl script which allows removing an installed OEM agent in the host. The process is quite straightforward just by invoking the AgentDeinstall.pl script located under:

$AGENT_HOME/sysman/install/AgentDeinstall.pl

[oracle@DB1 ~]$/u01/app/oracle/product/agent12c/core/12.1.0.3.0/perl/bin/perl  /u01/app/oracle/product/agent12c/core/12.1.0.3.0/sysman/install/AgentDeinstall.pl -agentHome /u01/app/oracle/product/agent12c/core/12.1.0.3.0


 Agent Oracle Home: /u01/app/oracle/product/agent12c/core/12.1.0.3.0


NOTE: The agent base directory: /u01/app/oracle/product/agent12c will be removed after successful deinstallation of agent home.


 DetachHome Command executed:/u01/app/oracle/product/agent12c/core/12.1.0.3.0/oui/bin/runInstaller -detachHome -force -depHomesOnly -silent ORACLE_HOME=/u01/app/oracle/product/agent12c/core/12.1.0.3.0 -waitForCompletion -invPtrLoc /u01/app/oracle/product/agent12c/core/12.1.0.3.0/oraInst.loc
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 5978 MB    Passed
The inventory pointer is located at /u01/app/oracle/product/agent12c/core/12.1.0.3.0/oraInst.loc
'DetachHome' was successful.
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 5978 MB    Passed
The inventory pointer is located at /u01/app/oracle/product/agent12c/core/12.1.0.3.0/oraInst.loc
The Oracle home '/u01/app/oracle/product/agent12c/sbin' could not be updated as it does not exist.


Deinstall Command executed:/u01/app/oracle/product/agent12c/core/12.1.0.3.0/oui/bin/runInstaller -deinstall -silent "REMOVE_HOMES={/u01/app/oracle/product/agent12c/core/12.1.0.3.0}" -waitForCompletion -removeAllFiles -invPtrLoc /u01/app/oracle/product/agent12c/core/12.1.0.3.0/oraInst.loc
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 5978 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-17_12-45-35PM. Please wait ...Oracle Universal Installer, Version 11.1.0.11.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.

Starting deinstall


Deinstall in progress (Tuesday, April 17, 2018 12:45:40 PM CST)
Configuration assistant "Agent Deinstall Assistant" succeeded
............................................................... 100% Done.

Deinstall successful

End of install phases.(Tuesday, April 17, 2018 12:46:15 PM CST)
End of deinstallations
Please check '/u01/app/oraInventory/logs/silentInstall2018-04-17_12-45-35PM.log' for more details.

Do you want us to delete the old oracle home [yes/no] :yes

NOTE: The targets monitored by this Management Agent will not be deleted in the Enterprise Manager Repository by this deinstall script. Make sure to delete the targets manually from the Cloud Control Console for a successful deinstallation.

Downloading and Importing a GPG Key

Under some circumstances, such as when installing additional software in a virtual machine domain, you might need to download and import the GPG key to use with yum. To obtain and import a GPG key from the public yum repository:
  1. Download the GPG key, for example with the the wget command.
    # wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
    The following are the available GPG keys:
  2. Check the fingerprint of the GPG key with the gpg command to make sure it matches the key published by Oracle.
    # gpg --quiet --with-fingerprint ./RPM-GPG-KEY-oracle-0l7
    The following are the published keys:
    • Oracle Linux 6 and 7:
      pub 2048R/EC551F03 2010-07-01 Oracle OSS group (Open Source Software group)
            Key fingerprint = 4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03
    • Oracle Linux 5:
      pub 1024D/1E5E0159 2007-05-18 Oracle OSS group (Open Source Software group)
            Key fingerprint = 99FD 2766 28EE DECB 5E5A F5F8 66CE D3DE 1E5E 0159 
      sub 1024g/D303656F 2007-05-18 [expires: 2015-05-16]
    • Oracle Linux 4:
      pub 1024D/B38A8516 2006-09-05 Oracle OSS group (Open Source Software group)
            Key fingerprint = 1122 A29A B257 825F 322C 234E 2E2B CDBC B38A 8516
      sub 2048g/0042D4F4 2006-09-05 [expires: 2011-09-04]
  3. If the fingerprint matches, import the GPG key with the rpm command.
    # rpm --import ./RPM-GPG-KEY-oracle-ol7

Error in invoking target ‘agent nmhs’ of makefile



Problem: 
When installing 11.2.0.4 on Redhat 7:
Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0.4/sysman/lib/ins_emagent.mk'.

Workaround:
in $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line: $(MK_EMAGENT_NMECTL)
Change it to: $(MK_EMAGENT_NMECTL) -lnnz11
7.2.4 Error During Oracle Database Installation on Oracle Linux 7
When installing Oracle Database 11g Release 2 (11.2.0.4) on Oracle Linux 7 and Red Hat Enterprise Linux 7, Oracle Universal Installer shows the following error message:

Error in invoking target 'agent nmhs' of makefile
When creating the database, the following error occurs:

Error securing Database Control

Apply patch 19692824 to the Database home:
https://updates.oracle.com/download/19692824.html

For additional information about how to apply the patch and when to apply the patch, refer to Note 1951613.1

This issue is tracked with Oracle bug 19692824.

KEYWORDS: 1951613.1, 19692824, ins_emagent, makefile, nhms

Setup PASS password manager on RHEL

Step 1 – Create A GPG Key

To begin using Pass you first need a GPG key.
You can create one by issuing the following command in a Linux Bash terminal on most distributions:

1
$ gpg --gen-key

Note: On Arch Linux Install GPG first with: sudo pacman -S gpg
The initial prompt will appear and looks like this:

1
2
3
4
5
6
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection?

Choose 1 which will enable both encryption and signing.
The next prompt asks for the keysize:

1
2
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)

Enter 2048 for the keysize.
Then read the next set of output:

1
2
3
4
5
6
7
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)

Most people make their keys valid until infinity, which is the default option. If you do this don’t forget to revoke the key when you no longer use it.
Enter 0 for infinity, or however long you wish.

1
2
3
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and E-mail Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Your next input from here should be your real name:

1
Real name:

Followed by your email address you wish to associate the key with (you can add more later!) :

1
E-mail address:

Here you can give the key a description that fits its purpose:

1
Comment:

This part is important and is the passphrase that you’ll use to open/decrypt your key that is generated. You can make it memorable but it’s essential that this follows a few precepts to make it strong and considered “secure”.
For Example: Contains symbols, contains upper & lower case characters, some numbers, no dictionary words, etc.

1
2
3
You need a Passphrase to protect your secret key.

Enter passphrase:

As the next prompt says type on the keyboard, move the mouse, and perform some actions that read/write to the machine’s hard drives.

1
2
3
4
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, use the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

If this is not enough or does not seem to update and complete after sometime, open up a new shell session and carry out these commands:

1
2
$ sudo apt-get install rng-tools
$ sudo rngd -r /dev/urandom

The process should now continue and include your new key’s location, value, and details.
With the main line reading:

1
public and secret key created and signed.

One more step you can complete locally is to set your key as the default key by entering this line in your ~/.bashrc file:

1
$ export GPGKEY=<key value>

Now restart the gpg-agent with:

1
2
$ killall -q gpg-agent
$ eval $(gpg-agent --daemon)

Then source your .bashrc again via:

1
$ source ~/.bashrc


Step 2 – Creating A Revocation Certificate

A revocation certificate must be generated to revoke your public key if your private key becomes compromised in any way.
It is recommended to create a revocation certificate when you create your key.
Note: Keep your revocation certificate on a medium that you can safely secure, like a thumb drive in a locked box. The revocation key may be printed and/or stored as a file. Take care to safeguard your revocation key.
To create a revocation certificate for your key carry out these two commands.
This first statement will create an environment variable in Bash containing the GPG key value you just created. Note that if you have other keys previously generated the value extracted with this command may be of a different key, this filters on the first key listed by the gpg program:

1
$ export GPGKEY="$(gpg -K | awk 'NR==3 {print $2}' | sed 's/2048R\///g')"

Now we create the revocation certificate by passing the $GPGKEY variable we defined:

1
$ gpg --output revoke.asc --gen-revoke $GPGKEY

Enter 0 for this multiple choice list.

1
2
3
4
5
6
7
8
Create a revocation certificate for this key? (y/N) y
Please select the reason for the revocation:
  0 = No reason specified
  1 = Key has been compromised
  2 = Key is superseded
  3 = Key is no longer used
  Q = Cancel
(Probably you want to select 1 here)

Enter something along the lines of - “Will be used if/when this key is ever compromised.”
This also needs ending with a new line.

1
2
3
Enter an optional description; end it with an empty line:
>
>

Now enter your key’s passphrase

1
2
You need a passphrase to unlock the secret key for
user:

The resultant message seen here means you successfully created your revocation certificate.

1
2
3
4
5
6
7
8
ASCII armoured output forced.
Revocation certificate created.

Please move it to a medium which you can hide away; if Mallory gets
access to this certificate he can use it to make your key unusable.
It is smart to print this certificate and store it away, just in case
your media become unreadable.  But have some caution:  The print system of
your machine might store the data and make it available to others!

Note: Mallory being a malicious attacker (less commonly called Trudy, an intruder.); unlike the passive Eve, this one is the active man-in-the-middle attacker who can modify messages, substitute his/her own messages, replay old messages, and so on. – Source
As indicated backup somewhere safe the revoke.asc file, in case you should ever need it in the future to invalidate your private key.
It can be found in your current working directory where you executed the initial gpg --output command.

Step 3 – Installing Pass

Arch Linux


1
$ sudo pacman -S pass

Debian / Ubuntu


1
$ sudo apt-get install pass


Step 4 – Initialising Pass

After installing Pass you need to initialise it with your GPG key from the previous steps.
In the same shell session as earlier use the environment variable $GPGKEY and supply it to Pass via the init parameter:

1
$ pass init $GPGKEY

This message will follow:

1
2
mkdir: created directory ‘/home/scarlz/.password-store’
Password store initialized for <KEYVALUE>.


Step 5 – Adding Password Entries

To add a new password entry to Pass, follow this next code snippet’s syntax:

1
$ pass insert email/proton-mail/count.elmsley@protonmail.com

This example was for an entry of an email address account in a descriptive hierarchy.
The prompt generated asks for the password that is to be associated and stored with this entry

1
2
3
4
mkdir: created directory ‘/home/scarlz/.password-store/email’
mkdir: created directory ‘/home/scarlz/.password-store/email/gmail’
Enter password for email/proton-mail/count.elmsley@protonmail.com:
Retype password for email/proton-mail/count.elmsley@protonmail.com:

The password is then read encrypted, and placed in ~/.password-store .
As the data stored in the encrypted files are plain text you can add any other details that go with an entry using the -mparameter. This creates the password with a multi-line entry where the first field is usually the password and the rest of the lines are the extra details such as usernames, emails addresses, etc.

1
$ pass insert -m email/proton-mail/count.elmsley@protonmail.com

Press CTRL + D to quit and confirm the entry when in multi-line mode.
To use Pass to generate a password for an entry on your behalf, use the generate option:

1
$ pass generate archlinux.org/wiki/username <n>

The <n> represents the number of characters you want the password to be in total. Replace it with a value like 16 to make the password lengthy enough.
There are some other options you can toggle like -n to exclude symbols from the password, and -c to send the password straight to the clipboard, and not print it to standard out once it’s created.

1
$ pass generate -n -c archlinux.org/wiki/username 16


Step 6 – Displaying & Accessing Passwords

The most basic and easiest way of displaying your password hierarchy tree is by running the program without any extra options:

1
$ pass
1
2
3
4
5
6
7
8
9
10
11
Password Store
├── Business
│   ├── some-silly-business-site.com
│   └── another-business-site.net
├── Email
│   ├── user@gmail.com
│   └── zx2c4.com
└── France
    ├── banking
    ├── freebox
    └── mobilephone

If you want to single out certain categories or sections of the tree use:

1
$ pass ls Email/

Which shows only:

1
2
3
├── Email
│   ├── user@gmail.com
│   └── zx2c4.com

To actually decrypt and retrieve a password, call the program and provide the path to the password:

1
$ pass Email/user@gmail.com

You will now have to enter or unlock your GPG key to see and display the password.
Instead of displaying the password in the terminal you can copy it to the clipboard for 45 seconds via -c :

1
$ pass -c Email/user@gmail.com

Which gives the message below and let’s you paste the password into any websites, forms, etc:

1
Copied Email/user@gmail.com to clipboard. Will clear in 45 seconds.


Step 7 – Removing & Editing Password Entries

You many need to remove passwords in the manager from time to time. This is done with the familiarly named rm and the path to the password file you want to remove.
Here an example:

1
$ pass rm email/proton-mail/count.elmsley@protonmail.com

To remove the folders in the process of the deletion include -r (recursively) in the command:

1
$ pass rm -r email/proton-mail/count.elmsley@protonmail.com

Normally there is a prompt to make sure you are certain you want to delete the password, this can be removed by using -fwhich is short for ‘force” :

1
$ pass rm -f email/proton-mail/count.elmsley@protonmail.com

To change an existing password and edit it replace rm with edit like this:

1
$ pass edit email/proton-mail/count.elmsley@protonmail.com


Step 8 – Git Version Control

Pass has support for Git tracking which would be ideal for private Git repositories but also in theory “safe” to put on a public service like Github, as the files are of course encrypted with GPG. Depending upon the strength of your passphrase too.
Make sure you have git installed on your system for this next section:

Arch Linux


1
$ sudo pacman -S git

Debian / Ubuntu


1
$ sudo apt-get install git

Here’s how the Git functionality works with pass:

1
$ cd /$USER/.password-store

Initialise the repository through pass:

1
$ pass git init

Add your remote repo address and name:

1
$ pass git remote add origin git-repo-address.com:repo-name

Set Git to push with these options:

1
$ pass git push -u --all

You can now add, edit, remove, and make changes then push them to your remote repository with:

1
$ pass git push


Step 9 – Shell Environment Variables

Here are three variables I found that seem potentially the most useful, should you ever need to fiddle with their functionality (there are others though).
PASSWORD_STORE_DIR
Overrides the default password storage directory.
$PASSWORD_STORE_GIT
Overrides the default root of the git repository, which is helpful if PASSWORD_STORE_DIR is temporarily set to a sub-directory of the default password store.
$PASSWORD_STORE_CLIP_TIME
Specifies the number of seconds to wait before restoring the clipboard, by default 45 seconds.

Step 10 – Exporting & Importing Keys

To transfer and move around a pass GPG key to other systems, follow these steps for a rudimentary solution.

Public Key

To see the current public GPG keys you have setup and active use:

1
$ gpg --list-keys

One of these will show the ID and details of your Pass key, use the key ID value to export the public key into a file with:

1
$ gpg -ao pass_public.key --export <key ID value>

Then transfer the generated pass_public.key onto your new system, and use the --import option to add it to GPG.
This is done with the command:

1
$ gpg --import pass_public.key

Private Key

To see the current private GPG keys you have setup and active use:

1
$ gpg --list-secret-keys

Like in the public key section, export the private key into a file with:

1
$ gpg -ao pass_private.key --export-secret-keys

Then transfer the generated pass_private.key onto your new system, and use the --import option to add it to GPG.
This is done with the command:

1
$ gpg --import pass_private.key

Trust Error

Sometimes after importing the key onto a new system you may get an error message similiar to:

1
gpg: There is no assurance this key belongs to the named user

Which appers when trying to encrypt a new file or edit an existing Pass entry.
If so use GPG to edit the key.

1
$ gpg --edit-key <Key Value>

At the prompt type:

1
> trust

Then from the numerical choices displayed enter a suitable value. The highest option 5 is fine if you know that this key is definetly your own and not a potentially unsafe key.

1
2
3
4
5
6
7
8
9
10
11
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

1 = I don't know or won't say
2 = I do NOT trust
3 = I trust marginally
4 = I trust fully
5 = I trust ultimately
m = back to the main menu

Your decision?

The operation you were trying to perform with Pass should now work as they key is trusted. Enter quit to leave the gpg prompt.