Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

This looks like it has nothing to do with permissions. You'd see a "permission denied", not a "command not found".

What's going on is that you seem to have . in your $PATH as root (which is insane), but not for your own account.

Is it safe to add . to my PATH? How come?Is it safe to add . to my PATH? How come?

Answer: no. You unpack a tar.gz, cd into the directory, and run ls. There's an executable in the directory called ls, which runs instead of /bin/ls. It modified your ~/.bashrc so the next time your run su and type in the root password, the attacker owns your machine.

If you want to run something in the current directory, run ./cmd

This looks like it has nothing to do with permissions. You'd see a "permission denied", not a "command not found".

What's going on is that you seem to have . in your $PATH as root (which is insane), but not for your own account.

Is it safe to add . to my PATH? How come?

Answer: no. You unpack a tar.gz, cd into the directory, and run ls. There's an executable in the directory called ls, which runs instead of /bin/ls. It modified your ~/.bashrc so the next time your run su and type in the root password, the attacker owns your machine.

If you want to run something in the current directory, run ./cmd

This looks like it has nothing to do with permissions. You'd see a "permission denied", not a "command not found".

What's going on is that you seem to have . in your $PATH as root (which is insane), but not for your own account.

Is it safe to add . to my PATH? How come?

Answer: no. You unpack a tar.gz, cd into the directory, and run ls. There's an executable in the directory called ls, which runs instead of /bin/ls. It modified your ~/.bashrc so the next time your run su and type in the root password, the attacker owns your machine.

If you want to run something in the current directory, run ./cmd

Source Link
Peter Cordes
  • 6.7k
  • 24
  • 42

This looks like it has nothing to do with permissions. You'd see a "permission denied", not a "command not found".

What's going on is that you seem to have . in your $PATH as root (which is insane), but not for your own account.

Is it safe to add . to my PATH? How come?

Answer: no. You unpack a tar.gz, cd into the directory, and run ls. There's an executable in the directory called ls, which runs instead of /bin/ls. It modified your ~/.bashrc so the next time your run su and type in the root password, the attacker owns your machine.

If you want to run something in the current directory, run ./cmd