I am running
Linux 4.4.0-116-generic Ubuntu + KDE ( x86_64 GNU/Linux )
I want to run an alias named
ksession that kills a particular session. At the same time I want that only I can run this alias and nobody else. So, I found
.bashrc file under
/root directory and added an alias by the name
ksession in it, then tried running
source command with no success and following errors :
amit@C0deDaedalus:~$ source /root/.bashrc bash: /root/.bashrc: Permission denied amit@C0deDaedalus:~$ sudo source /root/.bashrc sudo: source: command not found
Is there any way to
sourcethat file being a non-root user ?
I want to run the alias being a non-root user. Can I run it with sudo like this ?
$ sudo ksession
I tried that and failed with error :
amit@c0deDaedalus:~$ sudo ksession sudo: ksession: command not found
If not, Is there any workaround for running root aliases from a non-root user ?