1 of 7
GAD3R
  • 2.2k
  • 3
  • 18
  • 38

What is the risk of copy and past from a website?

Like all beginners in the Land of linux, I usually look for websites that contain Some Useful shell commands, mark it with my mouse, copy it (CTRL + C) and paste it into a terminal.

For example i need to install package_name.deb

sudo apt-get install package_name.deb

i will give my root password and install the package_name.deb

When i past this command to my text editor it will be something like:

sudo apt-get install package_name.deb && apt-get install suspicious_file.deb 

Second example :

i will add a new ppa (terminal)

sudo add-apt-repository ppa:some/ppa
sudo apt-get update

when i edit my sources.list i will find something like:

deb http://ppa.launchpad.net/some-ppa/

deb http://ppa.launchpad.net/a_suspicious_some-ppa/

As you can see, there is an invisible part, It does not appear on my terminal.

What is the risk of copy and past from an untrusted website in the terminal? How to repair operating systems if they are infected with some malware?

GAD3R
  • 2.2k
  • 3
  • 18
  • 38