Visual Studio Code asking to authenticate 'Default keyring' everytime I start - linux

I started using Linux lite 5.0 on my laptop last month. (I am fairly new to the Linux enviroment, just migrated from Windows 10).
So I installed Visual studio Code using snap and everytime I start it up, it asks to authenticate 'Default Keyring' until next reboot.
Is there anyway I can authorize it so I don't have to authenticate it everytime i reboot my pc?
(p.s the reason i moved from windows to linux is because my pc got hacked some weeks prior, so please consider security a major concern here)
Thanks in advance :)

In GDM+GNOME, when you login, GNOME Keyring is automatically unlocked. However, it doesn't do so in SDDM+KDE. When you start some GNOME or Electron application like VS Code, they ask you to type the login password again.
The solution is to edit /etc/pam.d/sddm and add pam_gnome_keyring.so like this (the second line and last line):
#%PAM-1.0
auth include common-auth
auth optional pam_gnome_keyring.so
account include common-account
password include common-password
session required pam_loginuid.so
session include common-session
session optional pam_gnome_keyring.so auto_start
This is a solution that I found here that should work for you. For me, the lines were already there, but I simply had to remove the - at the beginning of the lines.
EDIT: To edit the file, you'll need root privileges, so I did sudo -e /etc/pam.d/sddm in terminal, edited the lines, hit CTRL+X, and Y to save.

For anyone using VSCode on Windows / WSL - this is the solution https://github.com/MicrosoftDocs/live-share/issues/1782#issuecomment-1053563079
Go to your wsl terminal and install seahorse if you don't have it.
sudo apt-get update && sudo apt-get install seahorse
Run seahorse
seahorse
You should see a popup for GnuPG keys.
Click on the back button, then right-click on default keyring, and click delete.
After entering your keyring password, your default keyring should be gone.
But now vscode asks you to create one every time. To fix this remove gnome-keyring:
sudo apt-get remove gnome-keyring
Credits go to Austin Jerry (upsurge0)

This has nothing to do with visual studio, keyrings is a package in your system used to store your passwords read more about keyrings here
to solve your problem open gnome-shell and search: "seahorse"
open it and you will find all your keyrings setup, the default one is what you want,
select it right-click to edit or delete it if you are not remembering the password
But NOTE before you delete it any configurations with this keyring "default keyring" will be deleted with it too

I was using Chrome OS.
The Linux Terminal (AKA. crostini).
The "keep asking keyring" problem was caused by the keyring directory does not exist. So VS Code cannot save the keyring there.
The solution is simply create the directory.
You may use the following command.
mkdir ~/.local/share/keyrings

Related

Failed to run '/usr/local/go/bin/go env. The config change may not be applied correctly

Whenever i try save a go file inside vc code i get this pop up Failed to run '/usr/local/go/bin/go env. The config change may not be applied correctly. . Also there is any no go intelliSense, code navigation, and code editing support.
I guess, you are using go modules and have go.mod file inside project directory. In this case, inside VsCode, go to preferences. Under extensions, select Go. Untick checkbox labelled "Infer GOPATH from the workspace root." for both "User" and "Workspace".
Close all terminal and VsCode instance, and restart VsCode. It should no longer display the error, and prompt message to install Go Tools. Else you can manually install go tools from VsCode (pressing crtl/cmd + shift + P), which will bring back intellisense and linting.
In case you are using Mac OS and installed Go via homebrew add
"go.goroot": "/opt/homebrew/opt/go/libexec"
To your settings.json file. The path may be different. Check it via export GOROOT="$(brew --prefix golang)/libexec".
Also see install go on mac
I have solved this issue. The solution is that, create a new Golang project and move all the required logic files from older project to newer project and it will work. The problem is with .mod and .sum files. It is a older project that i have created on my other laptop that has Ubuntu based Feren OS. When I moved this project to my newer laptop that has Ubuntu based Zorin OS. It creates problem. So after trying lots of solution, I just created a new Golang project and moves all the required files and it works.

Sudo apt-get install in terminal asking for password

I'm using the AI Platform notebook and I want to install cuda because the Tensorflow can't use GPU.
sudo apt-get install cuda-cudart-10-0
Then in the command line it's asking me for password.
(base) jupyter#cuda-10-1-20201008-115420:~/tutorials/stylegan2$ sudo apt-get install cuda-cudart-10-0
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for jupyter:
Sorry, try again.
I don't recall I gave it any password while setting it up. Is there a default password for it?
To answer the first question, our Notebooks provide TensorFlow and when you create it, you can select to install Nvidia Driver automatically. Probably this option was missed during instance creation.
With respect to the second question, from the output, seems to be that you are in Jupyter Terminal.
Jupyter Notebooks provides access to Instance OS which could be Debian 9/10 or we support Ubuntu now. Jupyter Terminal process is running as jupyter user. While you can still run process as root. I would suggest you that you login via SSH and run commands directly from there. If you create the Notebook via UI we now provide OS login feature which allows you to access instance via SSH with IAM permissions hence your Google Cloud user account. If you are not sure of any of this, please contact your IT admin.
What do you think sudo does? If this is your first time using a Linux system, know that prepending every command in Linux with sudo is same as typing cmd in the windows run box and then pressing shift+enter. sudo is a way to tell the OS that I need admin rights (or in Linux's case, root permissions). So, it is bound to ask you for the password.
The password it is asking for is your account password. Also, it is usually a good idea to set up the root password when in first use. To set it up, drop into the root prompt from your user account using sudo su. Then type in passwd to set up a new password for the root user. Log out, and restart the machine.
Do not forget that root account has the ultimate privileges, and unless absolutely necessary, it is always better to prepend the command with sudo instead of dropping into the root prompt.
PS: A hint: sudo <command> followed by the caller's password is same as su -c '<command>' followed by the root account's password
You also might want to take a look at fakeroot
Which linux distro are you on? Like Kali has default password as root or toor or kali depending on version

Disabling asterisks in Linux Mint 19.1

I recently switched to Linux Mint 19.1.
While typing passwords in terminal it shows asterisks. How can I edit my sudoers file to disable them (not deleting but disabling)?
Just execute the script below:
sudo mv /etc/sudoers.d/0pwfeedback /etc/sudoers.d/0pwfeedback.disabled
The above line will disable the functionality of the 0pwfeedback package. Thus, the asterisks will be disappeared. Many solutions on the web are saying to delete it. Do not do that. In case you will need the asterisks back you will enable it again. This is how it must be done.

How to start anaconda-navigator with root Privileges ? (Linux)

After starting "anaconda-navigator" with a terminal, it ends up with dialogue box prompting that " it can't be run with root privileges.anaconda-navigator startup error as root.
For anaconda-3 run:
source ~/anaconda3/bin/activate root
anaconda-navigator
Hopefully this will solve everything.
I have exactly the same issue that you have and after trying the shocking solutions provided i ended up with more errors as you can find in some of my comments there.
How to Fix this:
The dialogue box as you and I see it, is a common dialogue in the Linux world, it has only one reason and that is your GUI is logged with a "normal user" but somehow you managed to install the anaconda with superuser(root).
so if possible, head to your login section and login with root user + with GUI activated(only saying this because there's a big Linux world out there)
if this didn't help, re-install it but be careful when uninstalling it as python can mess a lot of things up(its an OS bomb actually).
How to prevent this:
1- do not allow Anaconda installation to use any superuser areas like /root
2- try to install it with normal user and with sudo command
Good luck (the thing we all need with python installers)
The installation process should be done with the regular user but no root. In my case, the problem appears when I installed with superuser session. I follow these instructions, installing just with my username (without sudo privileges) and the problem was solved.
In /home/user/anaconda3/lib/python3.7/site-packages/anaconda_navigator/app/start.py:
if (MAC or LINUX) and os.environ.get('SUDO_UID', None) is not None:

PhpStorm update on Ubuntu/Mint

I am running PhpStorm on Linux Mint installed in /opt. PhpStorm is notifying me that there is an update available (8.0.3), but then it tells me it doesn't have write permission to apply the update, and that I should run it as a privileged user to update it.
If I run phpstorm.sh as root/sudo it asks for license info and looks as though it's running the installer rather than the program. PhpStorm is licensed when I run it from the desktop.
So how can I run updates?
I had the same issue and was able to change ownership of the PhpStorm folder to get it to work. Assuming your username is newownername and PhpStorm installation is located in /opt/phpstorm, the command should look like this:
chown -R newownername /opt/phpstorm
Note that you should change username and path to appropriate values.
No need (and not recommended) to change the ownership or the permissions of the opt/phpstorm directory. In fact, the error message returned says exactly what you should do: run it as a privileged user to update it.
After exiting PHPStorm, you can run it as a privileged user using the following instructions
sudo updatedb && sudo locate phpstorm.sh
sudo /path/to/phpstorm.sh
The first instruction updates the locate database and returns the location of the phpstorm executable in your computer.
Use the returned location as the path in the second instruction.
When starting PHPStorm as root, it will start with the default settings. It might even ask you if you want to apply your license... No need to change any of this: the default settings and running PHPStorm in evaluation mode will work just fine. After it starts, check for updates in the menu Help and apply them normally. PHPStorm might restart once again as root. Just close it once more and restart normally. When restarting as your user, you'll be given the ability to select your normal settings (usually stored in your user's directory: the path will be suggested). Accept and continue. PHPStorm will start with all your preferences and settings restored and properly upgraded.
If plugin updates are required, you can update them normally. No need to do it using root.
This solution is recommended by JetBrains. Changing the ownership or the permissions of the opt/phpstorm directory is not recommended and in fact pointed as incorrect by Jet Brains, as you can verify on their answer regarding the process of upgrading a similar product: Fixed: PyCharm automatic update fails on Linux due to permissions.
sudo chown -R $USER:$USER /opt/PhpStorm* , worked for me.
JetBrains are publishing their entire IDE portfolio as snaps, including PHPStorm. Snaps work on all supported versions of Ubuntu, including 14.04 and on Linux Mint 17.x and 18.x.
Some of the advantages of the JetBrains snaps are that they are always up to date, will automatically stay updated and are very easy to install.
To install PHPStorm in Ubuntu or Linux Mint:
sudo apt install snapd
sudo snap install phpstorm --classic

Resources