Why root Can't open file for writing?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
[root@localhost ~]# vim /usr/lib64/sas12/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level:3
:wq
An error occurs.
"/usr/lib64/sas12/smtpd.conf" E212: Can't open file for writing.
Why root can't open file for writing?
permissions root
add a comment |Â
up vote
2
down vote
favorite
[root@localhost ~]# vim /usr/lib64/sas12/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level:3
:wq
An error occurs.
"/usr/lib64/sas12/smtpd.conf" E212: Can't open file for writing.
Why root can't open file for writing?
permissions root
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
[root@localhost ~]# vim /usr/lib64/sas12/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level:3
:wq
An error occurs.
"/usr/lib64/sas12/smtpd.conf" E212: Can't open file for writing.
Why root can't open file for writing?
permissions root
[root@localhost ~]# vim /usr/lib64/sas12/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
log_level:3
:wq
An error occurs.
"/usr/lib64/sas12/smtpd.conf" E212: Can't open file for writing.
Why root can't open file for writing?
permissions root
asked Oct 29 '17 at 11:56
it_is_a_literature
21232350
21232350
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
Check that the /usr/lib64/sas12 directory already exists:
root@host:~# ls /usr/lib64/sas12
If it is not the case, you must create the directory before attempting to create the file:
root@host:~# mkdir -p /usr/lib64/sas12
root@host:~# vim /usr/lib64/sas12/smtpd.conf
You vim
command should now work as expected.
add a comment |Â
up vote
0
down vote
Either the filesystem is mounted read-only or this is not a root
permission problem but a vim
feature. Use a different editor or change the file permissions (e.g. make root
the file owner), edit the file, and change them back.
add a comment |Â
up vote
0
down vote
This can happen if there is a swap file as well at the same location which might set a lock on the file for editing.
example please look for the file
/usr/lib64/sas12/.smtpd.conf.swp
If this file exists, then you can't edit the file. Try removing it and then editing it should work.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Check that the /usr/lib64/sas12 directory already exists:
root@host:~# ls /usr/lib64/sas12
If it is not the case, you must create the directory before attempting to create the file:
root@host:~# mkdir -p /usr/lib64/sas12
root@host:~# vim /usr/lib64/sas12/smtpd.conf
You vim
command should now work as expected.
add a comment |Â
up vote
1
down vote
accepted
Check that the /usr/lib64/sas12 directory already exists:
root@host:~# ls /usr/lib64/sas12
If it is not the case, you must create the directory before attempting to create the file:
root@host:~# mkdir -p /usr/lib64/sas12
root@host:~# vim /usr/lib64/sas12/smtpd.conf
You vim
command should now work as expected.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Check that the /usr/lib64/sas12 directory already exists:
root@host:~# ls /usr/lib64/sas12
If it is not the case, you must create the directory before attempting to create the file:
root@host:~# mkdir -p /usr/lib64/sas12
root@host:~# vim /usr/lib64/sas12/smtpd.conf
You vim
command should now work as expected.
Check that the /usr/lib64/sas12 directory already exists:
root@host:~# ls /usr/lib64/sas12
If it is not the case, you must create the directory before attempting to create the file:
root@host:~# mkdir -p /usr/lib64/sas12
root@host:~# vim /usr/lib64/sas12/smtpd.conf
You vim
command should now work as expected.
answered Oct 29 '17 at 12:38
WhiteWinterWolf
1,586830
1,586830
add a comment |Â
add a comment |Â
up vote
0
down vote
Either the filesystem is mounted read-only or this is not a root
permission problem but a vim
feature. Use a different editor or change the file permissions (e.g. make root
the file owner), edit the file, and change them back.
add a comment |Â
up vote
0
down vote
Either the filesystem is mounted read-only or this is not a root
permission problem but a vim
feature. Use a different editor or change the file permissions (e.g. make root
the file owner), edit the file, and change them back.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Either the filesystem is mounted read-only or this is not a root
permission problem but a vim
feature. Use a different editor or change the file permissions (e.g. make root
the file owner), edit the file, and change them back.
Either the filesystem is mounted read-only or this is not a root
permission problem but a vim
feature. Use a different editor or change the file permissions (e.g. make root
the file owner), edit the file, and change them back.
answered Oct 29 '17 at 12:09
Hauke Laging
53.6k1282130
53.6k1282130
add a comment |Â
add a comment |Â
up vote
0
down vote
This can happen if there is a swap file as well at the same location which might set a lock on the file for editing.
example please look for the file
/usr/lib64/sas12/.smtpd.conf.swp
If this file exists, then you can't edit the file. Try removing it and then editing it should work.
add a comment |Â
up vote
0
down vote
This can happen if there is a swap file as well at the same location which might set a lock on the file for editing.
example please look for the file
/usr/lib64/sas12/.smtpd.conf.swp
If this file exists, then you can't edit the file. Try removing it and then editing it should work.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
This can happen if there is a swap file as well at the same location which might set a lock on the file for editing.
example please look for the file
/usr/lib64/sas12/.smtpd.conf.swp
If this file exists, then you can't edit the file. Try removing it and then editing it should work.
This can happen if there is a swap file as well at the same location which might set a lock on the file for editing.
example please look for the file
/usr/lib64/sas12/.smtpd.conf.swp
If this file exists, then you can't edit the file. Try removing it and then editing it should work.
edited Jul 2 at 10:50
Kevin Lemaire
1,046421
1,046421
answered Jul 2 at 9:06
satish arya
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401203%2fwhy-root-cant-open-file-for-writing%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password