View previous topic :: View next topic |
Author |
Message |
LegionOfHell Apprentice
Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Mon Aug 03, 2020 9:44 pm Post subject: I ran startx as root, did I mess anything up ? |
|
|
So I ran startx as root...but it did not start...after some startx's(none of them started x) I realized that I had been running it as root. So I did:
Code: | su root
chown -R <user>:<user> /home/<user>/* |
Is everything Ok now ? I am using bspwm, urxvt, vim, Tor browser(portable version), nnn and zathura. |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3005 Location: Edge of marsh USA
|
Posted: Tue Aug 04, 2020 3:10 am Post subject: Re: I ran startx as root, did I mess anything up ? |
|
|
LegionOfHell wrote: | So I ran startx as root...but it did not start...after some startx's(none of them started x) I realized that I had been running it as root. So I did:
Code: | su root
chown -R <user>:<user> /home/<user>/* |
Is everything Ok now ? I am using bspwm, urxvt, vim, Tor browser(portable version), nnn and zathura. |
You are probably OK. You probably did not have to run chown. If you run startx as root, it runs in root's directory.
But, if there was a reason to do so, you should have run:
Code: | chown -R <user>:<user> /home/<user> |
in order to pick up all of your hidden files (dot files), which are those that begin with the dot/period character.
Now, does X run OK as your user? _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
LegionOfHell Apprentice
Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Tue Aug 04, 2020 2:37 pm Post subject: |
|
|
Quote: | Now, does X run OK as your user?
|
it does
You mean the following command does not work on hidden/dot files ? (I have to get rid of *) ?
Code: | chown -R <user>:<user> /home/<user>/* |
|
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181
|
Posted: Tue Aug 04, 2020 3:13 pm Post subject: |
|
|
As far as I know, * doesn't include hidden files by default. You can verify that with:
Code: | ls -d /home/<user>/* |
|
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3005 Location: Edge of marsh USA
|
Posted: Tue Aug 04, 2020 4:30 pm Post subject: |
|
|
fturco wrote: | As far as I know, * doesn't include hidden files by default. You can verify that with:
Code: | ls -d /home/<user>/* |
|
"ls -d" never returns hidden files. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1732 Location: Germany
|
Posted: Tue Aug 04, 2020 6:11 pm Post subject: |
|
|
as figueroa already said, you probably do not need to change anything. Since you started it as root, everything needed and stored would be in the root home and not in your non-root-user home. So there should be no files created in your non-root-user home by starting x as root _________________ Forum Guidelines
PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Last edited by Banana on Wed Aug 05, 2020 8:20 am; edited 1 time in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Wed Aug 05, 2020 12:55 am Post subject: |
|
|
figueroa wrote: | fturco wrote: | As far as I know, * doesn't include hidden files by default. You can verify that with:
Code: | ls -d /home/<user>/* |
|
"ls -d" never returns hidden files. |
Code: | $ (cd; ls -d .gitconfig)
.gitconfig | It would be more accurate to say that -d inhibits listing a directory's contents, and instead lists exactly the things named on the command line; and that shell globs do not allow * to match a leading .. |
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181
|
Posted: Thu Aug 06, 2020 10:36 am Post subject: |
|
|
figueroa wrote: | fturco wrote: | As far as I know, * doesn't include hidden files by default. You can verify that with:
Code: | ls -d /home/<user>/* |
|
"ls -d" never returns hidden files. |
What about the following commands?
Code: | shopt -s dotglob
ls -d /home/<user>/* |
|
|
Back to top |
|
|
Linubie Guru
Joined: 11 Jun 2004 Posts: 382
|
Posted: Thu Aug 06, 2020 3:56 pm Post subject: |
|
|
How about
or
Code: | ls -aR /home/<user> |
_________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
|
fturco Veteran
Joined: 08 Dec 2010 Posts: 1181
|
Posted: Fri Aug 07, 2020 6:35 am Post subject: |
|
|
The fact is LegionOfHell is interested in using the chown command, not ls. My goal was to show which files/directories the * is expanded into before running chown. I probably could have used echo instead of ls, too. |
|
Back to top |
|
|
LegionOfHell Apprentice
Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Fri Aug 07, 2020 6:08 pm Post subject: |
|
|
Should I use the following command to see if a file is owned by root ?:
Code: | find /home/<user>/ -user {root} |
|
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3005 Location: Edge of marsh USA
|
Posted: Fri Aug 07, 2020 6:22 pm Post subject: |
|
|
LegionOfHell wrote: | Should I use the following command to see if a file is owned by root ?:
Code: | find /home/<user>/ -user {root} |
|
Why not? But, you can't put the userid root or any other in parenthesis, squiggly or otherwise. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6148 Location: Dallas area
|
Posted: Fri Aug 07, 2020 7:09 pm Post subject: |
|
|
All files root/root
find ~ -uid 0 -gid 0 -ls
All files owned by root
find ~ -uid 0 -ls
All files with group root
find ~ -gid 0 -ls _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
LegionOfHell Apprentice
Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Fri Aug 07, 2020 9:16 pm Post subject: |
|
|
All of my files start with the '.' character except the following folders: Downloads(was empty), fcron(holds the fcron script), tor(the web browser) and a sampleprog.c file that I don't care about(actually deleted it)
So i guess I didn't mess up anything by running: chown -Rv l3gi0n:l3gi0n /home/l3gi0n/*
So if a file belongs to the group root it might not have been altered by a program ran as root and using chown can change the files group....right ?
The following files are owned by root:root: find ~ -uid 0 -gid 0 -ls
Code: | /home/user/.config/bspwm/bspwmrc
/home/user/.config/sxhkd/sxhkdrc
/home/user/.vimrc
/home/user/.asoundrc |
*:root(find ~ -gid 0 -ls) and root:*(find ~ -uid 0 -ls) return the same thing...
Should I chown each one of them like this: chown user:user /home/user/.config/bspwm/bspwmrc
After this, i am good ....right ? |
|
Back to top |
|
|
|