Cannot change printer settings without root access

Nils Kassube kassube at gmx.net
Sun Jan 11 18:34:31 UTC 2015


Ralf Mardorf wrote:
> On Sun, 11 Jan 2015 13:12:53 +0100, Ralf Mardorf wrote:
> > I didn't follow this thread, what do you want to archive by 'sudo
> > chown -R $USER:$USER $HOME'?

Change the ownership of all files in the user's directory to be owned by 
the user again. This may become necessary after using sudo with a 
graphical application (instead of kdesudo / gksudo).

> > [rocketmouse at archlinux ~]$ echo $USER
> > rocketmouse
> > 
> > [rocketmouse at archlinux ~]$ sudo -i
> > [root at archlinux ~]# echo $USER
> > root
> > 
> > [rocketmouse at archlinux ~]$ su
> > [root at archlinux rocketmouse]# echo $USER
> > rocketmouse
> > 
> > To e.g. check if something is started with or without root
> > privileges
> > $USER is useless, then there's the need to check the id:

The trick of the command is that the user wants to change file ownership 
back to the user. The command above is for copy and paste use. It 
doesn't matter if you run the command as root or ordinary user - but it 
is meant to be run as ardinary user. Remember, the shell substitutes the 
variables before it starts sudo, so that makes the command (for me):

sudo chown -R nils:nils /home/nils

and for you it would be

sudo chown -R rocketmouse:rocketmouse /home/rocketmouse

Usually I wouldn't expect that someone uses "sudo -i" prior to that 
command because then it would be pointless to run the command with sudo. 
However if you would run the command as root, it wouldn't increase the 
damage because the command would be

sudo chown -R root:root /root

after the variable substitution. So it wouldn't change the home folder 
of the user but that of root. That may not be the wanted result, but as 
I wrote before, you don't run sudo commands as root anyway.


Nils





More information about the kubuntu-users mailing list