Centos Install Keychain
Creating GPG Keys Using the Command Line. Use the following shell command: $ gpg2 -gen-key This command generates a key pair that consists of a public and a private key. Other people use your public key to authenticate and/or decrypt your communications.
-->All packages are available on our GitHub releases page. After the package is installed, runpwsh
from a terminal. Run pwsh-preview
if you installed a Preview release.
Note
PowerShell 7 is an in-place upgrade that removes PowerShell Core 6.x.
The /usr/local/microsoft/powershell/6
folder is replaced by /usr/local/microsoft/powershell/7
.
If you need to run PowerShell 6 side-by-side with PowerShell 7, reinstall PowerShell 6 using thebinary archive method.
For Linux distributions that aren't officially supported, you can try to install PowerShell usingthe PowerShell Snap Package. You can also try deploying PowerShell binaries directly usingthe Linux tar.gz
archive, but you would need to set up the necessary dependencies based onthe OS in separate steps.
Officially supported releases
- Ubuntu 16.04
- Ubuntu 18.04
- Debian 8
- Debian 9
- Debian 10
- Alpine 3.9 and 3.10
- CentOS 7
- Red Hat Enterprise Linux (RHEL) 7
- Fedora 28
- Fedora 29
- Fedora 30
- openSUSE 42.3
- openSUSE Leap 15
Community supported releases
- Ubuntu 18.10
- Ubuntu 19.04
- Arch Linux
- Kali
- Raspbian (experimental)
Alternate install methods
- Snap Package
- Binary Archives
- .NET Global tool
Ubuntu 16.04
Installation via Package Repository - Ubuntu 16.04
PowerShell for Linux is published to package repositories for easy installation and updates.
The preferred method is as follows:
As superuser, register the Microsoft repository once. After registration, you can updatePowerShell with sudo apt-get upgrade powershell
.
Installation via Direct Download - Ubuntu 16.04
Download the Debian package powershell-lts_7.0.0-1.ubuntu.16.04_amd64.deb
from the releases pageonto the Ubuntu machine.
Then, in the terminal, execute the following commands:
Note
The dpkg -i
command fails with unmet dependencies. The next command, apt-get install -f
resolves these issues then finishes configuring the PowerShell package.
Uninstallation - Ubuntu 16.04
Ubuntu 18.04
Installation via Package Repository - Ubuntu 18.04
PowerShell for Linux is published to package repositories for easy installation and updates.
The preferred method is as follows:
As superuser, register the Microsoft repository once. After registration, you can updatePowerShell with sudo apt-get upgrade powershell
.
Installation via Direct Download - Ubuntu 18.04
Download the Debian package powershell-lts_7.0.0-1.ubuntu.18.04_amd64.deb
from the releases pageonto the Ubuntu machine.
Then, in the terminal, execute the following commands:
Note
The dpkg -i
command fails with unmet dependencies. The next command, apt-get install -f
resolves these issues then finishes configuring the PowerShell package.
Uninstallation - Ubuntu 18.04
Ubuntu 18.10
Installation is supported via snapd
. For instructions, see Snap Package.
Note
Ubuntu 18.10 is an interim release that's community supported.
Ubuntu 19.04
Installation is supported via snapd
. For instructions, see Snap Package.
Note
Ubuntu 19.04 is an interim release that's community supported.
Debian 8
Installation via Package Repository - Debian 8
PowerShell for Linux is published to package repositories for easy installation and updates.
The preferred method is as follows:
As superuser, register the Microsoft repository once. After registration, you can updatePowerShell with sudo apt-get upgrade powershell
.
Debian 9
Installation via Package Repository - Debian 9
PowerShell for Linux is published to package repositories for easy installation and updates.
The preferred method is as follows:
As superuser, register the Microsoft repository once. After registration, you can updatePowerShell with sudo apt-get upgrade powershell
.
Installation via Direct Download - Debian 9
Download the Debian package powershell-lts_7.0.0-1.debian.9_amd64.deb
from the releases page ontothe Debian machine.
Then, in the terminal, execute the following commands:
Uninstallation - Debian 9
Debian 10
Note
Debian 10 is only supported in PowerShell 7.0 and newer.
Installation via Package Repository - Debian 10
PowerShell for Linux is published to package repositories for easy installation and updates.
The preferred method is as follows:
Installation via Direct Download - Debian 10
Download the tar.gz package powershell_7.0.0-linux-x64.tar.gz
from the releases pageonto the Debian machine.
Then, in the terminal, execute the following commands:
Alpine 3.9 and 3.10
Note
Alpine 3.9 and 3.10 are only supported in PowerShell 7.0 and newer.
Installation via Direct Download - Alpine 3.9 and 3.10
Download the tar.gz package powershell-7.0.0-linux-alpine-x64.tar.gz
from the releases page ontothe Alpine machine.
Then, in the terminal, execute the following commands:
CentOS 7
Installation via Package Repository (preferred) - CentOS 7
PowerShell for Linux is published to official Microsoft repositories for easy installation andupdates.
As superuser, register the Microsoft repository once. After registration, you can update PowerShellwith sudo yum update powershell
.
Installation via Direct Download - CentOS 7
Using CentOS 7, download the RPM package powershell-lts-7.0.0-1.rhel.7.x86_64.rpm
from the releasespage onto the CentOS machine.
Then, in the terminal, execute the following commands:
You can install the RPM without the intermediate step of downloading it:
Uninstallation - CentOS 7
Red Hat Enterprise Linux (RHEL) 7
Installation via Package Repository (preferred) - Red Hat Enterprise Linux (RHEL) 7
PowerShell for Linux is published to official Microsoft repositories for easy installation andupdates.
As superuser, register the Microsoft repository once. After registration, you can update PowerShellwith sudo yum update powershell
.
Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
Download the RPM package powershell-lts-7.0.0-1.rhel.7.x86_64.rpm
from the releases page onto theRed Hat Enterprise Linux machine.
Then, in the terminal, execute the following commands:
You can install the RPM without the intermediate step of downloading it:
Uninstallation - Red Hat Enterprise Linux (RHEL) 7
openSUSE
Installation - openSUSE 42.3
Installation - openSUSE Leap 15
Uninstallation - openSUSE 42.3, openSUSE Leap 15
Fedora
Note
Fedora 28 is only supported in PowerShell 6.1 and newer.
Note
Fedora 29 and 30 are only supported in PowerShell 7.0 and newer.
Installation via Package Repository (preferred) - Fedora 28, 29, and 30
PowerShell for Linux is published to official Microsoft repositories for easy installation andupdates.
Installation via Direct Download - Fedora 28, 29, and 30
Download the RPM package powershell-7.0.0-1.rhel.7.x86_64.rpm
from the releases page onto theFedora machine.
Then, in the terminal, execute the following commands:
You can install the RPM without the intermediate step of downloading it:
Uninstallation - Fedora 28, 29, and 30
Arch Linux
Note
Arch support is not officially supported by Microsoft and is maintained by the community.
PowerShell is available from the Arch Linux User Repository (AUR).
- It can be compiled with the latest tagged release
- It can be compiled from the latest commit to master
- It can be installed using the latest release binary
Packages in the AUR are community maintained; there's no official support.
For more information on installing packages from the AUR, see the Arch Linux wikior Using PowerShell in Docker.
Snap Package
Getting snapd
snapd
is required to run snaps. Use these instructionsto make sure you have snapd
installed.
Installation via Snap
PowerShell for Linux is published to the Snap store for easyinstallation and updates.
The preferred method is as follows:
To install a preview version, use the following method:
After installation, Snap will automatically upgrade. You can trigger an upgrade usingsudo snap refresh powershell
or sudo snap refresh powershell-preview
.
Uninstallation
or
Kali
Note
Kali support is not officially supported by Microsoft and is maintained by the community.
Installation - Kali
Uninstallation - Kali
Raspbian
Currently, PowerShell is only supported on Raspbian Stretch.
CoreCLR and PowerShell will only work on Pi 2 and Pi 3 devices as other devices, like Pi Zero,have an unsupported processor.
Download Raspbian Stretch and follow theinstallation instructionsto get it onto your Pi.
Installation - Raspbian
Optionally, you can create a symbolic link to start PowerShell without specifying the path to thepwsh
binary.
Uninstallation - Raspbian
Installing Preview Releases
When installing a PowerShell Preview release for Linux via a Package Repository, the package namechanges from powershell
to powershell-preview
.
Installing via direct download doesn't change, other than the file name.
The following table contains the commands to install the stable and preview packages using thevarious package managers:
Distribution(s) | Stable Command | Preview Command |
---|---|---|
Ubuntu, Debian | sudo apt-get install -y powershell | sudo apt-get install -y powershell-preview |
CentOS, RedHat | sudo yum install -y powershell | sudo yum install -y powershell-preview |
Fedora | sudo dnf install -y powershell | sudo dnf install -y powershell-preview |
Install as a .NET Global tool
If you already have the .NET Core SDK installed, it's easy to install PowerShellas a .NET Global tool.
The dotnet tool installer adds ~/.dotnet/tools
to your PATH
environment variable. However, thecurrently running shell does not have the updated PATH
. You should be able to start PowerShellfrom a new shell by typing pwsh
.
Binary Archives
PowerShell binary tar.gz
archives are provided for Linux platforms to enable advanced deploymentscenarios.
Dependencies
PowerShell builds portable binaries for all Linux distributions. But, .NET Core runtime requiresdifferent dependencies on different distributions, and PowerShell does too.
The following chart shows the .NET Core 2.0 dependencies that are officially supported on differentLinux distributions.
OS | Dependencies |
---|---|
Ubuntu 16.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu55 |
Ubuntu 17.10 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu57 |
Ubuntu 18.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu60 |
Debian 8 (Jessie) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu52 |
Debian 9 (Stretch) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.2, libicu57 |
CentOS 7 Oracle Linux 7 RHEL 7 | libunwind, libcurl, openssl-libs, libicu |
openSUSE 42.3 | libcurl4, libopenssl1_0_0, libicu52_1 |
openSUSE Leap 15 | libcurl4, libopenssl1_0_0, libicu60_2 |
Fedora 27 Fedora 28 | libunwind, libcurl, openssl-libs, libicu, compat-openssl10 |
To deploy PowerShell binaries on Linux distributions that aren't officially supported, you need toinstall the necessary dependencies for the target OS in separate steps. For example, ourAmazon Linux dockerfile installs dependencies first, and then extracts theLinux tar.gz
archive.
Installation - Binary Archives
Linux
Uninstalling binary archives
Paths
$PSHOME
is/opt/microsoft/powershell/7/
- User profiles will be read from
~/.config/powershell/profile.ps1
- Default profiles will be read from
$PSHOME/profile.ps1
- User modules will be read from
~/.local/share/powershell/Modules
- Shared modules will be read from
/usr/local/share/powershell/Modules
- Default modules will be read from
$PSHOME/Modules
- PSReadLine history will be recorded to
~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
The profiles respect PowerShell's per-host configuration, so the default host-specific profilesexists at Microsoft.PowerShell_profile.ps1
in the same locations.
PowerShell respects the XDG Base Directory Specification on Linux.
GNOME Keyring is 'a collection of components in GNOME that store secrets, passwords, keys, certificates and make them available to applications.'
- 3Using the keyring outside GNOME
- 3.1Without a display manager
- 3.1.2Console login
- 3.1Without a display manager
- 4SSH keys
- 5Tips and tricks
- 6Troubleshooting
Installation
When using GNOME, gnome-keyring is installed automatically as a part of the gnome group. Otherwise install the gnome-keyring package. Install libsecret to allow applications to use your keyrings. libgnome-keyring is deprecated, however, some applications may require it.
Extra utilities related to GNOME keyring include:
- secret-tool — Access the GNOME keyring (and any other service implementing the DBus Secret Service API) from the command line.
- https://wiki.gnome.org/Projects/Libsecret libsecret
- gnome-keyring-query — Provides a simple command-line tool for querying passwords from the password store of the GNOME Keyring. (uses the deprecated libgnome-keyring)
- gnome-keyring-queryAUR
- gkeyring — Query passwords from the command line. (uses the deprecated libgnome-keyring)
- https://github.com/kparal/gkeyring gkeyringAUR, gkeyring-gitAUR
Manage using GUI
You can manage the contents of GNOME Keyring using Seahorse. Install it with the package seahorse.
It is possible to leave the GNOME keyring password blank or change it. In seahorse, in the 'View' drop-down menu, select 'By Keyring'. On the Passwords tab, right click on 'Passwords: login' and pick 'Change password.' Enter the old password and leave empty the new password. You will be warned about using unencrypted storage; continue by pushing 'Use Unsafe Storage.'
Using the keyring outside GNOME
Without a display manager
Automatic login
If you are using automatic login, then you can disable the keyring manager by setting a blank password on the login keyring.
Console login
When using console-based login, the keyring daemon can be started by either PAM or xinitrc. PAM can also unlock the keyring automatically at login.
PAM method
Start the gnome-keyring-daemon from /etc/pam.d/login
:
Add auth optional pam_gnome_keyring.so
at the end of the auth
section and session optional pam_gnome_keyring.so auto_start
at the end of the session
section.
For SDDM, edit instead the configuration file /etc/pam.d/sddm
.
Next, for GDM, add password optional pam_gnome_keyring.so
to the end of /etc/pam.d/passwd
.
- To use automatic unlocking, the same password for the user account and the keyring have to be set.
- You will still need the code in
~/.xinitrc
below in order to export the environment variables required.
xinitrc method
Start the gnome-keyring-daemon from xinitrc:
See Xfce#SSH agents for use in Xfce.
With a display manager
When using a display manager, the keyring works out of the box for most cases. The following display managers automatically unlock the keyring once you log in:
For GDM and LightDM, note the keyring must be named login to be automatically unlocked.
To enable the keyring for applications run through the terminal, such as SSH, add the following to your ~/.bash_profile
, ~/.zshenv
, or similar:
SSH keys
To add your SSH key:
To list automatically loaded keys:
To disable all keys:
Now when you connect to a server, the key will be found and a dialog will popup asking you for the passphrase. It has an option to automatically unlock the key when you log in. If you check this, you will not need to enter your passphrase again!
Alternatively, to permanently save the a passphrase in the keyring, use ssh-askpass from package seahorse:
.pub
file in the same directory as the private key (~/.ssh/id_rsa.pub
in the example). Also, make sure that the public key is the file name of the private key plus .pub
(for example, my_key.pub
).Start SSH and Secrets components of keyring daemon
If you are starting Gnome Keyring with a display manager or the Pam method described above and you are NOT using Gnome, Unity or Mate as your desktop you may find that the SSH and Secrets components are not being started automatically.You can fix this by copying the desktop files gnome-keyring-ssh.desktop and gnome-keyring-secrets.desktop from /etc/xdg/autostart/
to ~/.config/autostart/
and deleting the OnlyShowIn line.
Disable keyring daemon components
If you wish to run an alternative SSH agent (e.g. ssh-agent or gpg-agent), you need to disable the ssh
component of GNOME Keyring.To do so in an account-local way, copy /etc/xdg/autostart/gnome-keyring-ssh.desktop
to ~/.config/autostart/
and then append the line Hidden=true
to the copied file. Then log out.
SSH_AUTH_SOCK
to point to gnome-keyring regardless if it is running or not. To prevent this, you need to set the environment variable GSM_SKIP_SSH_AGENT_WORKAROUND before gnome-shell is started. One way to do this is to add the line GSM_SKIP_SSH_AGENT_WORKAROUND DEFAULT=1
to ~/.pam_environment
.Tips and tricks
Integration with applications
Flushing passphrases
This command starts gnome-keyring-daemon, shutting down previously running instances.
Git integration
The GNOME keyring is useful in conjuction with Git when you are pushing over HTTPS.
Install the libsecret package.
Set Git up to use the helper:
Next time you do a git push, you are asked to unlock your keyring, if not unlocked already.
GnuPG integration
Several applications which use GnuPG require a pinentry-program
to be set. Set the following to use Gnome 3 pinentry for Gnome Keyring to manage passphrase prompts.
Another option is to force loopback for GPG which should allow the passphrase to be entered in the application.
Troubleshooting
Passwords are not remembered
If you get a password prompt every time you login, and you find that passwords are not saved, you might need to create/set a default keyring.
Ensure that the seahorse package is installed, open it ('Passwords and Keys' in system settings) and select View > By Keyring.If there is no keyring in the left column (it will be marked with a lock icon), go to File > New > Password Keyring and give it a name. You will be asked to enter a password. If you do not give the keyring a password it will be unlocked automatically, even when using autologin, but passwords will not be stored securely. Finally, right-click on the keyring you just created and select 'Set as default'.
Resetting the keyring
If you get the error 'The password you use to login to your computer no longer matches that of your login keyring', you'll need to change the keyring password. You can do this using seahorse, by right-clicking on 'default keyring', and selecting 'Change Password'.
Alternatively, you can remove 'login.keyring' and 'user.keystore' from /home/{username}/.local/share/keyrings/. Be warned that this will permanently delete all saved keys. After removing the files, simply log out and log in again.
See also
- вторник 21 апреля
- 39