E212: Не могу открыть файл для записи, я должен использовать sudo. Есть ли другой способ [closed]

Я использовал vim для создания sa.sh в / home / guoyanzhang , когда я использовал : wq , появляется предупреждение следующим образом:

"sa.sh" E212: Can't open file for writing
Press ENTER or type command to continue

my system infomation is as follows:

guoyanzhang@debian:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
guoyanzhang@debian:~$ whoami
guoyanzhang
guoyanzhang@debian:~$ ls -l /home/
total 4
dr-xr-xr-x 10 guoyanzhang guoyanzhang 4096 Aug 11 02:07 guoyanzhang
guoyanzhang@debian:~$ touch sa.sh
touch: cannot touch 'sa.sh': Permission denied
-3
задан 12 August 2020 в 04:54

1 ответ

This indicates that the file was not created by user "guoyanzhang", or if it is a new file that you want to create, you have a problem with the permissions of your home folder.

In your home you can also simply test a touch file.test, if you have the same problem it will confirm the problem.

Do an ls -l /home to see the permissions of your home folder.

if the rights are incorrect you will need to use sudo to change them.

0
ответ дан 24 August 2020 в 08:21

Другие вопросы по тегам:

Похожие вопросы: