- Permission Denied error: Python 3.8 on Windows Gitbash
- 3 Answers 3
- Почему получаю при работе с git на windows Permission denied (publickey)?
- Ошибка bash permission denied
- Ошибка bash permission denied
- Выводы
- IntelliJ IDEA git Permission denied (publickey)
- 3 Answers 3
- Update IDEA 2020.3
- Permission denied (publickey) errors on Windows when using Moovweb
- 2 Answers 2
Permission Denied error: Python 3.8 on Windows Gitbash
New to Python. I get the following error on doing a python —version on my GitBash. . Appdata/Local/Microsoft/WindowsApps/python3: Permission Denied
Based on some answers on this forum I turned off the App execution aliases for python. Doing this deleted the two «stubs» python.exe and python3.exe from my Windows App folder and resulted in another error of No such file or directory to my python —version on GitBash.
I am a novice to python so it gets annoying to be stuck at the installation itself. What am I missing here .
It’s December and all these updates from Microsoft I assume has still not fixed this issue. Or?
3 Answers 3
To fix this Problem you need to install the required Python-Windows-Version (In my case it was 3.9). Then you search for Edit environment variables for your account in the startmenu. Open up the PATH -Variable and move the PATH for %USERPROFILE%\AppData\Local\Microsoft\WindowsApps below the PATH of your Python-Installation.
Now you enter manage app execution aliases into the windows search and deactivate the 2 Entrys for python there.
The last thing you need to do is to open your Python-Installation-Folder. This folder is usually at %USERPROFILE%\AppData\Local\Programs\Python\Python39 (If you’re using Python 3.9) Don’t forget to change the path to your Python-version (e.g. Python38).
Copy the file python.exe in the same directory and rename the copy to python3.exe . So you have both python.exe and python3.exe in the installation-folder.
You can find a similar solution to this problem here
Почему получаю при работе с git на windows Permission denied (publickey)?
Всем привет.
Не могу работать с гитом по ssh, сгенерил ключ, добавил его на github, сделал ssh-add.
И всё равно получаю:
Получаю такое и при использовании CMD, PowerShell, Git Bash.
Гит установлен, система windows, последнее обновление x64, OpenSSH agent в службах запущен.
- Вопрос задан 20 мая 2020
- 5407 просмотров
> сгенерил ключ
чем, как?
> сделал ssh-add
какой командой? в какой оболочке?
> Получаю такое и при использовании CMD, PowerShell, Git Bash.
получаете в ответ на какую команду?
2) Git Bash: — пардон, не получается сделать ssh-add потому что пишет — , попытался сделать eval «ssh-agent» , получил на это:
Но после этого ssh-add всё равно не работает.
3) git clone / git push -u origin margin
/.ssh теперь есть закрытый ключ id_rsa и открытый ключ id_rsa.pub. проверьте, так ли это.
> добавил его на github
в гитхаб вы добавляли открытый ключ
Ошибка bash permission denied
Многие новички пытаются выполнить запись определенных значений в системные файлы с помощью операторов перенаправления ввода и вывода и получают ошибку bash permission denied. Эта ошибка выводится, даже если вы использовали sudo.
Казалось бы, sudo есть, значит права суперпользователя получены и все должно работать но тут все не так просто. В этой статье мы рассмотрим почему возникает ошибка bash permission denied и как ее обойти.
Ошибка bash permission denied
Допустим, вы выполняете команду:
sudo echo «nameserver 8.8.8.8» >> /etc/resolv.conf
А в результате вместо записи строчки в /etc/resolv.conf получаете ошибку:
bash: /etc/resolv.conf permission denied
В русской локализации это будет отказано в доступе bash linux. Так происходит потому что вы запускаете с правами суперпользователя утилиту echo и она честно выводит вашу строку в стандартный вывод bash с правами суперпользователя. Но bash запущен от обычного пользователя, и когда интерпретатор bash пытается записать полученную строчку в системный файл, естественно, что вы получите ошибку.
Но существует несколько способов обойти это ограничение, вы можете, например, использовать команду tee, которая записывает стандартный вывод в файл или запустить саму оболочку от имени суперпользователя. Рассмотрим сначала вариант с tee:
echo ‘текст’ | sudo tee -a /путь/к/файлу
echo ‘nameserver 8.8.8.8’ | sudo tee -a /etc/resolv.conf
Это очень простое решение, но, кроме того, вы можете запустить оболочку bash с правами суперпользователя, чтобы дать ей доступ на запись:
sudo sh -c ‘echo текст >> /путь/к/файлу’
sudo bash -c ‘echo текст >> /путь/к/файлу’
sudo bash -c ‘echo nameserver 8.8.8.8 >> /etc/resolv.conf
Еще одно решение, призванное, упростить эту команду, добавить такой код в
sudoe() <
[[ «$#» -ne 2 ]] && echo «Usage: sudoe
» && return 1
echo «$1» | sudo tee —append «$2» > /dev/null
>
Дальше для вывода строки в файл выполняйте:
sudoe ‘текст’ >> /путь/к/файлу
sudoe «nameserver 8.8.8.8» > /etc/resolv.conf
Теперь все будет работать, как и ожидалось, и ошибка bash отказано в доступе не появится. Еще можно поменять права на файл, а потом уже выводить в него строку. Но это очень неправильное решение. И даже не потому, что это небезопасно, а больше потому что там намного больше действий.
Выводы
В этой небольшой статье мы разобрали почему возникает ошибка bash permission denied при использовании команды echo для системных файлов, а также несколько путей ее решения. Как видите, все достаточно просто. Надеюсь, эта информация была полезной для вас.
IntelliJ IDEA git Permission denied (publickey)
I got a strange problem with using git on IntelliJ IDEA on Windows 10. If I want to access the remote repo on GitLab, I always get Permission denied (publickey). Everything I found here or via Google didn’t solve the problem. I tried:
- Setting the ssh executable to Native
- Converting my public key from Putty to ssh-keygen style
- Removing known_hosts
I also tried to access the repo with Git Bash, it works fine like that. Another interesting fact is that after removing known_hosts, I got «Host key verification failed». I had to use Git Bash once to recreate the known_hosts entry, after that I got the Permission denied error again. Somehow I don’t get asked for any user input.
3 Answers 3
I faced this problem while connecting bitbucket cloud from my Intellij 2019.2 , which thankfully got solved with the following steps. Please note that these steps are to be carried out after you successfully generate and add ssh-public key to your bitbucket/github/gitlab profile.
- Open Git-SCM ssh_config file present in Git-SCM installation directory.It’s default location in Windows (for 64 bit) is in C:\Program Files\Git\etc\ssh\
- Add the following lines into ssh_config
/.ssh/id_rsa which equals to %USERPROFILE%\.ssh\id_rsa . To create the rsa file run PuttyGen, open your private key, from menu use Conversions — Export OpenSSH key and save it as %USERPROFILE%\.ssh\id_rsa . – Radek Pech Jan 29 at 12:30
Update IDEA 2020.3
The bug in Sahil’s answer has been fixed and Christian’s solution is not needed with the correct entry in your ssh config file for the most common case of one key for one or more hosts. Additional options for complex configurations, such as multiple keys to the same or multiple hosts, can be found in Maddes comprehensive answer on superuser.
ANY inconsistency between ssh-agent and ssh-add leads to a situation where some things work and some don’t.
For example, I had the Windows OpenSSH agent running but my path pointed first to the Git for Windows ssh-add . Many such failures are possible given the many ssh implementations out there, so know that you know where things are running from.
To get ssh working in IDEA.
Git for Windows
- Install Git for Windows. I put it in C:\Git since, as a standard user without an elevated install, I couldn’t write to C:\Program Files .
- In Control Panel | User Accounts | Change my environment variables add the Git usr\bin folder to the path after the cmd folder entry already there (e.g. C:\Git\usr\bin for my installation).
- If you set the environment variable HOME (like I did for Git) delete it; IDEA breaks if it’s set (been working this with JetBrains support all week).
- In a Windows cmd.exe console, run start-ssh-agent.cmd to start the agent
- In IDEA in Settings | SSH Configurations | Authentication type: set it to Key pair OpenSSH or PuTTY and test your connection. Then, make a small change and test Commit and push. .
Windows OpenSSH
- In Control Panel | User Accounts | Change my environment variables add C:\Windows\System32\OpenSSH to your path. Make sure no other ssh implementation is ahead of this in the path!
- Start the OpenSSH agent in Task Manager | Services (or any number of other ways)
- Set your IDEA SSH Configuration as #5 above
Permission denied (publickey) errors on Windows when using Moovweb
I’m able to authenticate, generate, push etc just fine with my SSH keys and Moovweb credentials on my Mac and Linux machines.
However, on my Windows machine, using Git Bash, I get an SSH Permission denied (publickey) error. The error message is below:
Seems like a Windows-specific SSH error. Any workarounds?
2 Answers 2
So as mentioned in prior answers, the Permission denied error in Windows is because you are trying to use a key other than id_rsa .
Windows lacks the bells and whistles that Linux and Mac have to try out all your public keys when trying to connect to a server via SSH. If you’re using the ssh command, you can tell it which key to use by passing the -i flag followed by the path to the key to use:
The above command should work just fine if you’ve uploaded moovweb_rsa.pub to the console (either via the moov login command or the console UI). However, trying any git related commands should fail because Git doesn’t give you the ability to chose which key to use when connecting to the git remote. Because of this, SSH is forced to use the default key, id_rsa , and if that key doesn’t work (or doesn’t exist), then the connection fails with a permission denied error.
One possible solution, as suggested in other answers, is to simply rename your key to id_rsa . For most people, this is a fine solution. However, if you already have an id_rsa key and you would prefer to use a different key with Moovweb, you can edit your
/.ssh/config file by adding the following contents:
If you append the above lines to your
/.ssh/config file (create it if it doesn’t exist), you should be able to successfully get Git to communicate with the Moovweb remote git server. The config basically tells SSH that for the given host ( git.moovweb.com ), SSH should use the given key rather than the default.
It’s worth nothing that this happens to all Git remotes; interactions with Github, Heroku, etc. also suffer through this problem in Windows. You could easily extend your
/.ssh/config file to use separate SSH keys for each one of those services if you so desired: