Author Topic: [IMPORTANT] Note about running commands  (Read 1292 times)

Brad

  • Lurker
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1512
    • View Profile
    • Brads Blawg
[IMPORTANT] Note about running commands
« on: December 30, 2009, 04:39:41 PM »
Just a heads up,

There are people out there that just come on the internets to break peoples servers etc, so if someone gives you commands to run into a server, here are a few guidelines to follow about running them:

Linux:
Commands that contain "rm" are dangerous, however they do have legit uses (such as removing a file), dont run them if you are not sure that it is only removing a file you want.
Watch out for these - they will delete all files on your HDD
Code: [Select]
rm -rf /
rm -rf .
rm -rf *

The following will format your HDD, and delete all your data
Code: [Select]
mkfs
mkfs.ext3

Sometimes they may look really interesting, like this happy little fellow:
Code: [Select]
:(){ :|:& };:
He is what we call a forkbomb; in laymans terms, this will cause so many processes to spawn, that your system will inevitably freeze, and require a hard reset to fix. This may also cause corruption and loss of data.

Also watch out for wget, sometimes wget can be used for good, but wget downloads files. Just dont run it if its not from a trusted source


Generally heres a rule of thumb. People with lots of posts 100+ you can trust, people with few 20 or less. Dont hesitate to ask if you dont trust it.
Just use common sense, if the code looks scary and long, it will probably kill the system (like the forkbomb) but this (will restart apache2)

Code: [Select]
sudo /etc/init.d/apache2 restart
Have fun!

PS: We operate a ZERO tolerance policy on malicious commands. If you are caught posting anything malicious, you will be banned; its really that simple.

From Admin:  I updated one of your commands to include spaces.  Without spaces it doesn't work ;) ~rvtraveller.
« Last Edit: September 14, 2010, 02:22:50 AM by Brad »
Regards, Brad

Masturbation. Taking matters into your own hands.

I er, finally have a website

Primefalcon

  • Hero Member
  • *****
  • Posts: 2168
  • https://launchpad.net/~primefalcon
    • View Profile
    • Prime's Tech Talk
Re: [IMPORTANT] Note about running commands
« Reply #1 on: December 30, 2009, 05:40:40 PM »
Just a couple of extra notes as well

first that that the R character will be uppercase a lot of times too such as

rm -Rf, just because that r is uppercase doesn't make it any less dangerous.....

also never run fsck or e2fsck while your drive is mounted, if you don't know what mounted means, just don't run them, the source your reading also gives clear instructions on how to unmount the filesystem first
Get 2.25G of space on Dropbox by CLICKING HERE, Rather than 2G otherwise. Sync files between multiple computers, Web and even share folders with your friends!

Mop

  • Hero Member
  • *****
  • Posts: 661
  • I POST CP
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #2 on: September 07, 2010, 08:29:21 AM »
Does this really need to be stickied? Are people really this stupid?

Brad

  • Lurker
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1512
    • View Profile
    • Brads Blawg
Re: [IMPORTANT] Note about running commands
« Reply #3 on: September 07, 2010, 11:11:33 AM »
You would be surprised...
Regards, Brad

Masturbation. Taking matters into your own hands.

I er, finally have a website

Pinako

  • Hero Member
  • *****
  • Posts: 1263
    • View Profile
    • inportb
Re: [IMPORTANT] Note about running commands
« Reply #4 on: September 07, 2010, 01:44:30 PM »
Surprise, surprise! A bunch of peepz tried to forkbomb my shell host :D

Also, be careful with rm -rf ~

Brad

  • Lurker
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1512
    • View Profile
    • Brads Blawg
Re: [IMPORTANT] Note about running commands
« Reply #5 on: September 07, 2010, 02:56:31 PM »
That erm, wasnt me  :D
Regards, Brad

Masturbation. Taking matters into your own hands.

I er, finally have a website

Primefalcon

  • Hero Member
  • *****
  • Posts: 2168
  • https://launchpad.net/~primefalcon
    • View Profile
    • Prime's Tech Talk
Re: [IMPORTANT] Note about running commands
« Reply #6 on: September 09, 2010, 10:36:27 AM »
The danger is people who don't know the Linux like type environments (windows users, since macs are unix and linux is based off Unix).

Windows users who are using a Linux environment to host that run into a problem will run whatever commands they are told will help.... and not everyone is.... nice about telling people what commands to run
Get 2.25G of space on Dropbox by CLICKING HERE, Rather than 2G otherwise. Sync files between multiple computers, Web and even share folders with your friends!

antimatter15

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #7 on: September 10, 2010, 11:56:33 PM »
Really, this post isn't doing any service to amateurs. The commands rm and mkfs are actually useful and you're just scaring people into not learning how to use the command line.

Just, btw, you spelled tolerance wrong, and normally I wouldn't care, but you bolded it and I tend to pay more attention to bolded text.

qserver

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #8 on: September 11, 2010, 08:18:51 AM »
this is really good and important warning..

antimatter15

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #9 on: September 11, 2010, 08:31:53 PM »
this is really good and important warning..
It's really not, people are really clever at hiding malicious code if that's their intent. The only thing this teaches people is to stay away from CLIs which isn't good.

Brad

  • Lurker
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1512
    • View Profile
    • Brads Blawg
Re: [IMPORTANT] Note about running commands
« Reply #10 on: September 12, 2010, 04:54:31 AM »
No it doesnt. It tells people to stay away from 3 very specific commands. I did not once say "Never use CLI its dangerous".

Please, if you have nothing constructive to say, dont. You seem to be here just to cause upset.
Regards, Brad

Masturbation. Taking matters into your own hands.

I er, finally have a website

Primefalcon

  • Hero Member
  • *****
  • Posts: 2168
  • https://launchpad.net/~primefalcon
    • View Profile
    • Prime's Tech Talk
Re: [IMPORTANT] Note about running commands
« Reply #11 on: September 12, 2010, 09:37:23 AM »
No it doesnt. It tells people to stay away from 3 very specific commands. I did not once say "Never use CLI its dangerous".

Please, if you have nothing constructive to say, dont. You seem to be here just to cause upset.
Agreed, and this is the exact same reason they have sticky's about this on the Ubuntu forums actually, so I 100% support this stickies thread
Get 2.25G of space on Dropbox by CLICKING HERE, Rather than 2G otherwise. Sync files between multiple computers, Web and even share folders with your friends!

antimatter15

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #12 on: September 13, 2010, 04:42:26 PM »
'Commands that contain "rm" are bad'

Yes, you NEVER EVER want to EVER delete a file.

Primefalcon

  • Hero Member
  • *****
  • Posts: 2168
  • https://launchpad.net/~primefalcon
    • View Profile
    • Prime's Tech Talk
Re: [IMPORTANT] Note about running commands
« Reply #13 on: September 13, 2010, 06:52:27 PM »
'Commands that contain "rm" are bad'

Yes, you NEVER EVER want to EVER delete a file.
LOl rm itself isn't bad but a user typically would not want to delete recursively with force from root or even home generally....
Get 2.25G of space on Dropbox by CLICKING HERE, Rather than 2G otherwise. Sync files between multiple computers, Web and even share folders with your friends!

Mop

  • Hero Member
  • *****
  • Posts: 661
  • I POST CP
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #14 on: September 13, 2010, 07:25:04 PM »
Plus there are way more ways to fu** your system then deleting stuff.

qserver

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #15 on: September 13, 2010, 10:53:41 PM »
'Commands that contain "rm" are bad'

hmm just suggestion,
change the word "bad" with something like "dangerous" seem more appropriate..

Mop

  • Hero Member
  • *****
  • Posts: 661
  • I POST CP
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #16 on: September 13, 2010, 11:14:14 PM »
Or possibly bad if used incorrectly

antimatter15

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
Re: [IMPORTANT] Note about running commands
« Reply #17 on: September 14, 2010, 07:47:39 PM »
Probably it would be better to say that running rm as root is bad. Then again, almost anything as root is bad. So pretty much, I would suggest deleting the entire OP and saying "Using Sudo is dangerous, try to minimize usage".

There aren't any commands more or less dangerous than others if you're running them as root. With great power comes great responsibility (as the spectacular sudoman's uncle ben says). People who aren't able to handle the power should just stick with synaptic for rootsy stuff.

It's a positive message that's simple and doesn't discourage people from using root and makes the community safer.

Pinako

  • Hero Member
  • *****
  • Posts: 1263
    • View Profile
    • inportb
Re: [IMPORTANT] Note about running commands
« Reply #18 on: September 14, 2010, 11:45:22 PM »
Probably it would be better to say that running rm as root is bad. Then again, almost anything as root is bad. So pretty much, I would suggest deleting the entire OP and saying "Using Sudo is dangerous, try to minimize usage".

The average computer user probably cares more about his/her data than about the program files, in which case cleaning up your home directory is probably equivalent to wiping root.

On the other hand, and I haven't tested this, if your home directory is mounted on a different device/filesystem, I think even if you try to delete / as root, you'd get a permission-denied error when you hit your home directory.

Primefalcon

  • Hero Member
  • *****
  • Posts: 2168
  • https://launchpad.net/~primefalcon
    • View Profile
    • Prime's Tech Talk
Re: [IMPORTANT] Note about running commands
« Reply #19 on: September 15, 2010, 11:40:30 AM »
Probably it would be better to say that running rm as root is bad. Then again, almost anything as root is bad. So pretty much, I would suggest deleting the entire OP and saying "Using Sudo is dangerous, try to minimize usage".

The average computer user probably cares more about his/her data than about the program files, in which case cleaning up your home directory is probably equivalent to wiping root.

On the other hand, and I haven't tested this, if your home directory is mounted on a different device/filesystem, I think even if you try to delete / as root, you'd get a permission-denied error when you hit your home directory.
hmmm not game to test that..... Your right the OS can easily be reinstalled, my data not so..... that's why I do have a separate home partition
Get 2.25G of space on Dropbox by CLICKING HERE, Rather than 2G otherwise. Sync files between multiple computers, Web and even share folders with your friends!