PDA

View Full Version : You might be trying to help, but you can still do damage...



Moozillaaa
February 13th, 2012, 03:41 AM
I would not run any code if it was not posted in the open forum, and I would NEVER run a rm -rf command without understanding what it does.



Words of GREAT wisdom.



Someone tried to help me in another thread. But if I had done what the person said, I could potentially have wiped not only 1 partition, but 2 partitions. I knew better than to blindly 'try' it.

Forums rules prohibit posting malicious code - stuff that can wipe out your data. But is ignorant code prohibited? Or stupid code? It can do the same damage, or worse damage, than malicious code.

If you don't know the answer, make it clear to others that you are guessing, before you post stuff that can cause BIG problems...

And it doesn't hurt to read posts. You might see that you're wrong, before wastefully re-arranging electrons. Slow down, and INput a little, before OUTputting anything.

JOHNNYG713
February 13th, 2012, 04:10 AM
Be sure !! Brain is engaged, . . . Before putting keyboard in to Gear !! :x

oldos2er
February 13th, 2012, 04:22 AM
Words of GREAT wisdom.



Someone tried to help me in another thread. But if I had done what the person said, I could potentially have wiped not only 1 partition, but 2 partitions. I knew better than to blindly 'try' it.

Forums rules prohibit posting malicious code - stuff that can wipe out your data. But is ignorant code prohibited? Or stupid code? It can do the same damage, or worse damage, than malicious code.


I assume you're referring to this thread. http://ubuntuforums.org/showthread.php?t=1923925

If you feel there's a problem with a post (or poster), use the Report Abuse button to bring it to staff's attention.

UltimateCat
February 13th, 2012, 04:35 AM
Moosillaa:
I am sorry to hear that happened to you.

That happened to me also...but not here at ubuntufourms.org

When I followed the code ( and at the time I didn't know it was malicious) it locked up and wrecked my system.

If it were me; I would file a complaint with a Moderator/Administrator

Anyway; Have A Good Week ;)

Sincerely,
UltimateCat

jasonrisenburg
February 13th, 2012, 04:42 AM
Aren't there several commands almost as bad as rm, just not as popular

Tamlynmac
February 13th, 2012, 07:21 AM
Moozillaaa

I think this is a multi-issue problem. Involving knowledge base and experience. Compounded (to some extent) by users who have a lack of understanding regarding the CLI and commands. Especially, new users who come here for support. Anticipating that the support offered is accurate and will resolve their problem(s).

The staff do everything possible to monitor and endeavoring to make all members aware of the potential. But they can't be everywhere on the site 24/7. There's a substantial volume of requests and responses almost everyday. Without filtering and evaluating every one, the situation you described can and might happen. If one were certain it was deliberate, I'm confident the staff would take immediate action - once reported.

I believe the community members try and respond with information that is safe and beneficial. Occasionally, I suspect stuff happens either through ignorance or lack of knowledge (rarely deliberate). With many new members having limiting if any experience with the CLI, they are in a position of compromise with regards to what information they receive and it's validity.

Since the forums are strictly volunteer and no Canonical tech support regularly exists here, the level of support may vary significantly. All members should be aware of this fact and not implement any commands, until they're confident said commands will have the desired impact.

I see no alternative - beyond awareness - based on the existing forum design. Finding it hard to make comments, when I don't have any better solutions. Volume wise, I'm sure that many users/members receive quality, knowledgeable assistance here. Should the forums close shop because of a few mistakes or should the members try to improve upon our responses and point out errors immediately? Not engaging in requests that may be beyond their level of experience/knowledge, but rather choosing to recognizing their own limitations.

Malicious code is that which is deliberately shared and intended to have a negative impact. One must ask themselves if malicious code was the problem or was it simply an error.

Just my $0.02

dcstar
February 13th, 2012, 07:27 AM
Words of GREAT wisdom.
.........
Someone tried to help me in another thread. But if I had done what the person said, I could potentially have wiped not only 1 partition, but 2 partitions. I knew better than to blindly 'try' it.
........


In that thread YOU are using the cp command totally inappropriately. It should never, ever be used in that way.
The answer in that thread that you seem to be complaining about is totally reasonable.
Unfortunately you don't seem to understand what you are doing with your system.

|{urse
February 13th, 2012, 07:54 AM
Linux assumes you know what you're doing <-- I just read that on someones sig, so true. Some people learn by breaking things, some people study until they know exactly what they're doing before they get their feet wet.

That said, be careful of anything you choose to try.. do a little research or learn the hard way. As for careless posting of rm -rf commands or dd commands or intentional postings of obfuscated rm -rf commands, it's very rare here and honestly, unless you take the time to know exactly what you're pasting into the terminal, well, you shouldn't be in the terminal. Thx for the pro-tip but there are already stickies for this sort of warning. ^_-

nothingspecial
February 13th, 2012, 02:54 PM
Not a support question.

Thread moved to The Community Cafe.


Linux assumes you know what you're doing <-- I just read that on someones sig

Probably mine :p

pbpersson
February 13th, 2012, 03:23 PM
In that thread two people suggested that rsync would be a better choice in the future for performing these types of backups instead of using the cp command to duplicate an entire partition onto another drive.

Is this not true? In what way would this command destroy two partitions?

http://en.wikipedia.org/wiki/Rsync

EDIT to add:

I just looked at the thread again, the portion in question must be the syntax for the "dd" command.

Habitual
February 13th, 2012, 03:42 PM
Be sure !! Brain is engaged, . . . Before putting keyboard in to Gear !! :x

+1 - Read Twice, Execute Once.

grahammechanical
February 13th, 2012, 04:03 PM
One of the great things about Linux is the ability to modify the OS. It also becomes one of the worse things about Linux when those new to Linux attempt to do things that they are too inexperienced to do.

The Command Line Interface is a great tool but like any tool it can be misused through ignorance and do damage.

It frustrates me when I see people get themselves in a mess and then expect not only a quick answer but a simple "do this" answer.

The quick and simple answer is "Re-install and lean the lesson of backing up your data."

That is not very helpful I know but it is a method that I have had to use a few times. Life is complicated enough as it is.

Regards.

kurt18947
February 13th, 2012, 04:27 PM
One of the great things about Linux is the ability to modify the OS. It also becomes one of the worse things about Linux when those new to Linux attempt to do things that they are too inexperienced to do.

The Command Line Interface is a great tool but like any tool it can be misused through ignorance and do damage.

It frustrates me when I see people get themselves in a mess and then expect not only a quick answer but a simple "do this" answer.

The quick and simple answer is "Re-install and lean the lesson of backing up your data."

That is not very helpful I know but it is a method that I have had to use a few times. Life is complicated enough as it is.

Regards.

Or have two (or more) separate OS installs -- one to use, one or more to abuse. Even with today's prices, hard disk space is cheap and an Ubuntu install will fit nicely in 10 GB. You just can't keep a bunch of DVD movie .isos in there too :).

|{urse
February 13th, 2012, 05:40 PM
Probably mine :p

Ah yea, that's who had it! Very useful afterthought on any forum post. :)

castrojo
February 13th, 2012, 06:00 PM
This is just a fundamental problem with forum software, no one can go back and fix mistakes someone else has made or fix it when it becomes out of date.

CharlesA
February 13th, 2012, 07:16 PM
In that thread two people suggested that rsync would be a better choice in the future for performing these types of backups instead of using the cp command to duplicate an entire partition onto another drive.

Is this not true? In what way would this command destroy two partitions?

http://en.wikipedia.org/wiki/Rsync

EDIT to add:

I just looked at the thread again, the portion in question must be the syntax for the "dd" command.
I must have missed something cuz I thought cp only worked with files, not devices. I use dd for copying entire drives.

I didn't see anything in the man page and the description of cp says that it copies files and directories.

josephmills
February 13th, 2012, 07:46 PM
DANAGE DANGER HIGH VOLTAGE
If you dont know what you are typing into the command line then DO NOT do it. ask one of the mod's or just on Irc and ask someone there. I mean there is even a bash channel on freenode.and tons of ubuntu channels.

As far as I know all comands are there for a reason. if you don't know the reason then ask.
here are some danger commands that you should look into

PLAYING around with anything that is not under your home folder can cause damage. please ask then ask again.

dd

this is great for copying whole drives but can also be danger


wget <somerandom site> wget is a great tool and I use it all the time but. you could download somethign that is bad for your coimuter and could spread to others. (partitions/media drives / wine / crossover.)


mkfs.ext3 /dev/sda
this will reformate youre hole harddrive


rm -rf /


umm no no put garbage in the trash (you could have put you ring in the garbage and might need to take it out the trash)



:(){:|:&};:


this is a forkbomb aka looppie louie please see
http://en.wikipedia.org/wiki/Fork_bomb



mv /home/yourhomedirectory/* /dev/null

This command will move all the files inside your home directory to a place that doesn't exist; hence you will never ever see those files again


please be aware that On IRC there is also SCUMBAGS
just last night there was some one that was ranting and raving. About how they had deleted 50 gigs of files. they where then aski ng others to run a code that would re-formate your harddrive.

I said in the channel.

"Duide if you do not know what a scripting code does please do not tell others to put it into there terminal. this is rude and careless"


I got a responce back from a good person say'in
"there is a language baerrier here and that is what is going on. If you can help the person then do not say anything"


I could not belive what I was reading. here is some dude/chick/whatever giving out code that would re-format someones harddrive I tell that person to stop and I get Yelled at WTF.
so I left for a little bit nd came back.

so just a warring if you like there is a great great great tutorial/guide for bashg here
http://mywiki.wooledge.org/BashGuide

take care and good luck

spynappels
February 13th, 2012, 08:21 PM
I'd just like to clarify, was the OP unhappy with my response in the referenced thread or someone else's?

The point the OP is making is exactly why I posted what I did.

CharlesA
February 13th, 2012, 08:23 PM
I'd just like to clarify, was the OP unhappy with my response in the referenced thread or someone else's?

The point the OP is making is exactly why I posted what I did.
I don't know. I looked at the thread that was referenced and I couldn't see anything that could have caused damage.

The only thing that I know that will copy a device /dev/sda to another device /dev/sdb is dd. cp is only for files.

EDIT: I didn't see a post by you in the thread I was looking at.

I did see one from the OP that was chastising another member for being willfully ignorant..

spynappels
February 13th, 2012, 08:37 PM
Ok, I just checked and the quote of my post did not come from the referenced thread. I guess that means the OP did not have a beef with anything I wrote.

The truism still holds though, be careful of commands where you're not sure what they do, and if you have the facility, test them in a sandboxed environment (hint: Virtualbox et al).

CharlesA
February 13th, 2012, 08:39 PM
Ok, I just checked and the quote of my post did not come from the referenced thread. I guess that means the OP did not have a beef with anything I wrote.

The truism still holds though, be careful of commands where you're not sure what they do, and if you have the facility, test them in a sandboxed environment (hint: Virtualbox et al).
Yep, that is quite true.

Also: Keep regular backups, they can save your skin.

Moozillaaa
February 13th, 2012, 08:57 PM
I'd just like to clarify, was the OP unhappy with my response in the referenced thread or someone else's?

The point the OP is making is exactly why I posted what I did.

I found your post while looking for forum rules about malicious code that was not intentional, but just as damaging.



In what way would this command destroy two partitions? This POSSIBLY is how (1 partition at least):

You copy partition 'a' to partition 'd'.

'd' is larger than 'a' when you start the task.

AFTER the partition copy task is complete, is partition 'd' identical in size to partition 'a'???

IF the write task completely re-defined 'd' partition, and made it identical in size to 'a' partition, then it SHOULD be safe to do the task in reverse - copy partition 'd' back to partition 'a'.

BUT...

IF the copy task did NOT re-define partition 'd', and make it identical in size to partition 'a', then what will happen if you attempt to copy the bigger 'd' partition INTO the smaller 'a' partition???

Perhaps the 'restored' 'a' partition would not be destroyed, as I think this through. But, what would happen to partition 'b', if the partition boundary gets 'bumped', by the copy task? Goodbye 'b'?

I think user matt_symes answered the question properly...

Moozillaaa
February 13th, 2012, 09:03 PM
cp is only for files.cp is for anything you want to copy. Files, partitions, devices, etc., etc., ...

Why some people take offense at learning new things is disappointing.


(if using cp /dev/sda /dev/sdd is against the Linux law, I hope no *no one* tell on me)

nothingspecial
February 13th, 2012, 09:05 PM
Anyone can make a typo and commands can be copied and pasted when they are not appropriate for the issue.

For example, a misplaced space in a path can lead to a command effecting /

Issuing commands from the wrong directory can also cause problems especially when globs such as * are used.

If you don't understand what a command is going to do, don't run it, or at least ask for a second opinion.

CharlesA
February 13th, 2012, 09:14 PM
cp is for anything you want to copy. Files, partitions, devices, etc., etc., ...

Why some people take offense at learning new things is disappointing.


(if using cp /dev/sda /dev/sdd is against the Linux law, I hope no *no one* tell on me)

The manpage I looked at made no mention of it being able to copy anything but files or directories.

Moozillaaa
February 13th, 2012, 09:22 PM
cp is for anything you want to copy. Files, partitions, devices, etc., etc., ...

Why some people take offense at learning new things is disappointing.


(if using cp /dev/sda /dev/sdd is against the Linux law, I hope *no one* tell on me)

Now that I think further on it, isn't that what intolerance is?

"You can't do that that way".

:confused:

CharlesA
February 13th, 2012, 09:40 PM
Calling someone out when they make a mistake has nothing to do with intolerance or the willingness to learn.

I think this thread has run it's course and thusly is closed.