Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I ran startx as root, did I mess anything up ?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 253
Location: Toronto, Canada

PostPosted: Mon Aug 03, 2020 9:44 pm    Post subject: I ran startx as root, did I mess anything up ? Reply with quote

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
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2966
Location: Edge of marsh USA

PostPosted: Tue Aug 04, 2020 3:10 am    Post subject: Re: I ran startx as root, did I mess anything up ? Reply with quote

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
View user's profile Send private message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 253
Location: Toronto, Canada

PostPosted: Tue Aug 04, 2020 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Tue Aug 04, 2020 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2966
Location: Edge of marsh USA

PostPosted: Tue Aug 04, 2020 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1415
Location: Germany

PostPosted: Tue Aug 04, 2020 6:11 pm    Post subject: Reply with quote

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
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.


Last edited by Banana on Wed Aug 05, 2020 8:20 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21768

PostPosted: Wed Aug 05, 2020 12:55 am    Post subject: Reply with quote

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
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Thu Aug 06, 2020 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Linubie
Guru
Guru


Joined: 11 Jun 2004
Posts: 365

PostPosted: Thu Aug 06, 2020 3:56 pm    Post subject: Reply with quote

How about

Code:
ls -a /home/<user>

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
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Fri Aug 07, 2020 6:35 am    Post subject: Reply with quote

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
View user's profile Send private message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 253
Location: Toronto, Canada

PostPosted: Fri Aug 07, 2020 6:08 pm    Post subject: Reply with quote

Should I use the following command to see if a file is owned by root ?:

Code:
find /home/<user>/ -user {root}
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2966
Location: Edge of marsh USA

PostPosted: Fri Aug 07, 2020 6:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Aug 07, 2020 7:09 pm    Post subject: Reply with quote

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
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 253
Location: Toronto, Canada

PostPosted: Fri Aug 07, 2020 9:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum