What to do when you remove permission for all users with chmod?
I am using Debian 8 stretch and I typed the command:
chmod a-wx *
Then my desktop turns black and I cannot reboot back to the OS.
debian chmod
add a comment |
I am using Debian 8 stretch and I typed the command:
chmod a-wx *
Then my desktop turns black and I cannot reboot back to the OS.
debian chmod
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23
add a comment |
I am using Debian 8 stretch and I typed the command:
chmod a-wx *
Then my desktop turns black and I cannot reboot back to the OS.
debian chmod
I am using Debian 8 stretch and I typed the command:
chmod a-wx *
Then my desktop turns black and I cannot reboot back to the OS.
debian chmod
debian chmod
edited Jan 5 at 19:47
GAD3R
2,4341226
2,4341226
asked Jan 2 at 14:32
scholar guyscholar guy
233
233
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23
add a comment |
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23
add a comment |
3 Answers
3
active
oldest
votes
Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd
into the directories anymore which is probably causing problems.
You should be able to add those permissions back, and there's a few options to do that:
If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (
rw
).
Or, you can try booting your main install in Single-user mode:
DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:
mount / -rw -o remount
- First screen - grub - press e
Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd
to your user's home folder and just run a "reverse":
chmod -v a+wx *
That should add back write permissions & let you cd
into directories again, and hopefully boot OK.
It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like
find [home folder] -maxdepth 1 -type f ! -name ".*" -print0 | xargs -0 chmod -v a-x
Another option is to just replace everything in your home with "defaults" from /etc/skel
then the next boot should be like the very first boot.
Or yet another option would be to just create a new user (while booted in single-user mode) using adduser
, and forget about or delete the whole old user (with deluser
)
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
add a comment |
Ctrl-alt and f1-f6 should work to get you into any other vtty.
From there your permissions can be restored by the root user.
add a comment |
I don't think it's possible, you may have to just salvage your files and re-install.
However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.
And I would like to say my congratulations for bricking your system. That was quite a move.
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1389801%2fwhat-to-do-when-you-remove-permission-for-all-users-with-chmod%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd
into the directories anymore which is probably causing problems.
You should be able to add those permissions back, and there's a few options to do that:
If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (
rw
).
Or, you can try booting your main install in Single-user mode:
DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:
mount / -rw -o remount
- First screen - grub - press e
Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd
to your user's home folder and just run a "reverse":
chmod -v a+wx *
That should add back write permissions & let you cd
into directories again, and hopefully boot OK.
It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like
find [home folder] -maxdepth 1 -type f ! -name ".*" -print0 | xargs -0 chmod -v a-x
Another option is to just replace everything in your home with "defaults" from /etc/skel
then the next boot should be like the very first boot.
Or yet another option would be to just create a new user (while booted in single-user mode) using adduser
, and forget about or delete the whole old user (with deluser
)
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
add a comment |
Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd
into the directories anymore which is probably causing problems.
You should be able to add those permissions back, and there's a few options to do that:
If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (
rw
).
Or, you can try booting your main install in Single-user mode:
DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:
mount / -rw -o remount
- First screen - grub - press e
Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd
to your user's home folder and just run a "reverse":
chmod -v a+wx *
That should add back write permissions & let you cd
into directories again, and hopefully boot OK.
It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like
find [home folder] -maxdepth 1 -type f ! -name ".*" -print0 | xargs -0 chmod -v a-x
Another option is to just replace everything in your home with "defaults" from /etc/skel
then the next boot should be like the very first boot.
Or yet another option would be to just create a new user (while booted in single-user mode) using adduser
, and forget about or delete the whole old user (with deluser
)
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
add a comment |
Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd
into the directories anymore which is probably causing problems.
You should be able to add those permissions back, and there's a few options to do that:
If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (
rw
).
Or, you can try booting your main install in Single-user mode:
DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:
mount / -rw -o remount
- First screen - grub - press e
Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd
to your user's home folder and just run a "reverse":
chmod -v a+wx *
That should add back write permissions & let you cd
into directories again, and hopefully boot OK.
It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like
find [home folder] -maxdepth 1 -type f ! -name ".*" -print0 | xargs -0 chmod -v a-x
Another option is to just replace everything in your home with "defaults" from /etc/skel
then the next boot should be like the very first boot.
Or yet another option would be to just create a new user (while booted in single-user mode) using adduser
, and forget about or delete the whole old user (with deluser
)
Since you only removed write & execute permission for files in your home directory, and it looks like there's no recursive option, so none of the contents of sub directories were affected, but you probably can't cd
into the directories anymore which is probably causing problems.
You should be able to add those permissions back, and there's a few options to do that:
If you've got a live USB / DVD handy, just boot it then mount your main install's home partition with write access (
rw
).
Or, you can try booting your main install in Single-user mode:
DEBIAN / UBUNTU root PASSWORD RECOVERY (with GRUB 2)
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:
mount / -rw -o remount
- First screen - grub - press e
Now that you've got access to your user's home (it's a good time to backup any important files, just in case) cd
to your user's home folder and just run a "reverse":
chmod -v a+wx *
That should add back write permissions & let you cd
into directories again, and hopefully boot OK.
It'll also add execute permission for regular files in your home directory, which isn't perfect but shouldn't cause any problems either. You could remove execute permission from non-hidden files with a GUI file manager, or something like
find [home folder] -maxdepth 1 -type f ! -name ".*" -print0 | xargs -0 chmod -v a-x
Another option is to just replace everything in your home with "defaults" from /etc/skel
then the next boot should be like the very first boot.
Or yet another option would be to just create a new user (while booted in single-user mode) using adduser
, and forget about or delete the whole old user (with deluser
)
answered Jan 3 at 7:01
Xen2050Xen2050
10.6k31536
10.6k31536
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
add a comment |
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
Thanks for the help
– scholar guy
Jan 3 at 7:10
Thanks for the help
– scholar guy
Jan 3 at 7:10
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
Welcome. If the answer's useful, it's better to vote it up (the up arrow to an answer's left) or if it's best then select it as correct (the check-mark to the left, it turns green when one answer is selected). [I appreciate the thanks too, but I guess if everyone did it the site would be filled with "thanks" everywhere.]
– Xen2050
Jan 3 at 7:19
add a comment |
Ctrl-alt and f1-f6 should work to get you into any other vtty.
From there your permissions can be restored by the root user.
add a comment |
Ctrl-alt and f1-f6 should work to get you into any other vtty.
From there your permissions can be restored by the root user.
add a comment |
Ctrl-alt and f1-f6 should work to get you into any other vtty.
From there your permissions can be restored by the root user.
Ctrl-alt and f1-f6 should work to get you into any other vtty.
From there your permissions can be restored by the root user.
answered Jan 5 at 20:42
Guy GastineauGuy Gastineau
314
314
add a comment |
add a comment |
I don't think it's possible, you may have to just salvage your files and re-install.
However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.
And I would like to say my congratulations for bricking your system. That was quite a move.
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
add a comment |
I don't think it's possible, you may have to just salvage your files and re-install.
However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.
And I would like to say my congratulations for bricking your system. That was quite a move.
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
add a comment |
I don't think it's possible, you may have to just salvage your files and re-install.
However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.
And I would like to say my congratulations for bricking your system. That was quite a move.
I don't think it's possible, you may have to just salvage your files and re-install.
However, according to this post, you may try cutting all the files off your broken OS and pasting them back in. The permissions might not be copied and you might be able to boot back in. All of this would be done from a recovery OS of course.
And I would like to say my congratulations for bricking your system. That was quite a move.
answered Jan 2 at 16:19
TheChubbyPandaTheChubbyPanda
1939
1939
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
add a comment |
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
Well fortunately I have nothing important in the OS as it happened the first day I download Debian
– scholar guy
Jan 3 at 5:20
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
In that case I would just reinstall to save you all the hassle.
– TheChubbyPanda
Jan 3 at 8:58
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1389801%2fwhat-to-do-when-you-remove-permission-for-all-users-with-chmod%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Were you running this command as a root user, or with sudo? What directory did you run it in? I'm guessing only your user's home?
– Xen2050
Jan 3 at 0:59
Yes I think I ran it in the folder containing home
– scholar guy
Jan 3 at 5:18
That's a lot easier to fix then, I'll try an answer
– Xen2050
Jan 3 at 6:30
Welcome aboard. Although you got an answer here, I just wanted to make you (and others) aware of our sister site for questions about Unix & Linux
– Mawg
Jan 3 at 7:23