I would like to use sudo instead of su or su -, as twice this week I’ve forgotten to logout of root.
However, sudo returns
sudo: *<command>*: command not found
if <command> is in /sbin or /usr/sbin (eg init). This post seems to fix this:
but I must confess I don’t know what a .zshrc file is or where I find it (it’s not in ~/ and google sheds no light). What are the security/safety implications of making this change?
I would like to use sudo instead of su or su -, as twice this week I’ve forgotten to logout of root.
May I suggest another solution? A timeout for root-shells should do the trick. Add this to /etc/bash.bashrc.local:
if "`id -u`" -eq 0 ]; then
IDLELOGOUT=300
echo "
Automatic logout after five minutes without input or job
"
export TMOUT=$IDLELOGOUT
fi
[In case you don’t have a /etc/bash.bashrc.local yet, just create it.]
You can configure ‘IDLELOGOUT’ as you please of course. The timeout will be reset whenever there is a job running or input happening.
kalle@hoppers:~> su -
Password:
Automatic logout after five minutes without input or job
hoppers:~ # timed out waiting for input: auto-logout
kalle@hoppers:~>
i’m a newbie here.
I try to run several commands but I face the problem.
for example:
zahian@linux-9h2w:~> $tar -xvzf RT2870_Linux_STA_V2.3.0.0.bz2
If ‘-xvzf’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf -xvzf
zahian@linux-9h2w:~> cnf -xvzf
-xvzf: command not found
zahian wrote:
> for example:
> zahian@linux-9h2w:~> $tar -xvzf RT2870_Linux_STA_V2.3.0.0.bz2
> If ‘-xvzf’ is not a typo you can use command-not-found to lookup the
> package that contains it, like this:
> cnf -xvzf
this is crazy, i know…but, is tar installed? what do you get with
which tar
if the which shows tar in your path, then ???
-is it executable?
-if not, why not?
-what happens if you use YaST (or zypper) to replace your tar?
do you have any other problems? i mean, maybe you have an all around
faulty install, from a disk full of errors (or only one: a bogus tar)
did you:
I think you’re problem lies in the fact that you run this command:
**$**tar -xvzf RT2870_Linux_STA_V2.3.0.0.bz2
But you should have used this command instead:
tar -xvzf RT2870_Linux_STA_V2.3.0.0.bz2
In the first command the “$” will let bash think you mean a variable like $PATH, $PWD, $HOME etc.
But the variable $tar is empty so bash will execute the command:
>
> hi guyz,
>
> i’m a newbie here.
> I try to run several commands but I face the problem.
>
> for example:
> zahian@linux-9h2w:~> $tar -xvzf RT2870_Linux_STA_V2.3.0.0.bz2
Looks like you have an extra ‘$’ in there - should just be tar -xvzf …
> If ‘-xvzf’ is not a typo you can use command-not-found to lookup the
> package that contains it, like this:
> cnf -xvzf
When you entered ‘$tar’, the shell thought that was a variable name. There
is no variable named ‘tar’, so it defaulted to a null string. Then it took
the first non-null field (’-xvzf’) to be the command name and couldn’t find
it.
>
> zahian@linux-9h2w:~> cnf -xvzf
>
> -xvzf: command not found
>
> could anyone please tell me what should I do…
>