Cannot change printer settings without root access
Ralf Mardorf
kde.lists at yahoo.com
Sun Jan 11 12:12:53 UTC 2015
On Sun, 11 Jan 2015 06:49:33 -0500, Clay Weber wrote:
> > sudo chown -R $USER:$USER $HOME
> > That should avoid wrong substitutions. :)
> Yes, you are correct, but often it is clearer to users the long way ;)
I didn't follow this thread, what do you want to archive by 'sudo chown -R $USER:$USER $HOME'?
[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:
if [ "$(id -u)" = "0" ]; then printf "\nDon't run this script as root :).\n\n"; exit 1; fi
However, usage of $HOME is risky too:
[rocketmouse at archlinux ~]$ echo $HOME
/home/rocketmouse
[rocketmouse at archlinux ~]$ sudo -i
[root at archlinux ~]# echo $HOME
/root
[rocketmouse at archlinux ~]$ su
[root at archlinux rocketmouse]# echo $HOME
/root
I don't want to reboot and check how my *buntu installs behave, but they
likely behave in the same way ;).
Regards,
Ralf
More information about the kubuntu-users
mailing list