WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how does hexedit change my boot record without sudo  (Read 6557 times)

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
how does hexedit change my boot record without sudo
« on: February 05, 2012, 12:14:31 PM »
how does hexedit change my boot record without sudo
 in all partition in tc user [without root permision]
example `hexedit /dev/sda6` and change NTLDR in to GRLDR in FAT16
 [and the old GRLDR file copy {grub4dos} boot correctly from sda6]

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: how does hexedit change my boot record without sudo
« Reply #1 on: February 05, 2012, 01:07:55 PM »
Sounds like you should not be using hexedit.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: how does hexedit change my boot record without sudo
« Reply #2 on: February 05, 2012, 01:39:59 PM »
Sounds like you should not be able to use hexedit for this purpose, as a non-root user.  I'd be curious to know the details about for every thing involved.

I've often mistakenly used the mount and umount commands w/o sudo and had them work.  This sort of thing is worrisome, though no biggie in my personal situation.  I've always chalked it up to some misconfiguration on my part - one of those things I'll look into some day.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11656
Re: how does hexedit change my boot record without sudo
« Reply #3 on: February 05, 2012, 01:54:13 PM »
Hi Lee
If the drive you wish to mount is listed in  /etc/fstab  and the fourth column (mount options) contains
the word  users , you don't need  sudo  to mount it, just  mount /mnt/sdb1  will suffice, as will
mount /dev/sdb1.
« Last Edit: February 05, 2012, 01:57:03 PM by Rich »

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
Re: how does hexedit change my boot record without sudo
« Reply #4 on: February 05, 2012, 02:45:39 PM »
Sounds like you should not be using hexedit.

no it is not bad thing when recovery ...
is dd write thesame on all disks and partitions

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: how does hexedit change my boot record without sudo
« Reply #5 on: February 05, 2012, 03:25:24 PM »
You have started multiple threads with questions that make no sense and demonstrate
a lack of understanding of basic Linux concepts.

Instead of beating around the bush, it would be better if you clearly stated what you are trying to accomplish,
what you have tried, and what does not work.

There is an old computer saying.
GIGO
Garbage In Garbage Out.
You will not get good answers with bad questions.

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
Re: how does hexedit change my boot record without sudo
« Reply #6 on: February 06, 2012, 08:34:55 AM »
You have started multiple threads with questions that make no sense and demonstrate
a lack of understanding of basic Linux concepts.

Instead of beating around the bush, it would be better if you clearly stated what you are trying to accomplish,
what you have tried, and what does not work.

There is an old computer saying.
GIGO
Garbage In Garbage Out.
You will not get good answers with bad questions.

# ok from begining
# in tc standard user named tc
dd if=/dev/sdb1 of=sdb1
hexedit /dev/sdb1  # make change and save
hexedit /dev/sdb1  # check if change are correctly written
dd if=sdb1 of=/dev/sdb1
hexedit /dev/sdb1  # check if change are restored
# and changes are restored it is a good thing for an recovery linux
# but why writing to partition without sudo su

# ok from begining the only question from which version of TC this is possible

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: how does hexedit change my boot record without sudo
« Reply #7 on: February 06, 2012, 09:02:26 AM »
No version of tc will allow you to violate standard unix permissions.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: how does hexedit change my boot record without sudo
« Reply #8 on: February 06, 2012, 10:59:44 AM »
If the drive you wish to mount is listed in  /etc/fstab  and the fourth column (mount options) contains
the word  users , you don't need  sudo  to mount it, just  mount /mnt/sdb1  will suffice, as will
mount /dev/sdb1.

Thanks for that tip, Rich.  Clearly I have some reading to do about mount and fstab, but the worry about permissions on mounting becomes a non-issue.  That also takes my point into the realm of "off topic" for this thread.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11656
Re: how does hexedit change my boot record without sudo
« Reply #9 on: February 06, 2012, 11:34:34 AM »
Hi ibug
If you enter  ls -l /dev/sda1  you will get back
brw-rw---- 1 root staff 8, 1 Dec 10 21:44 /dev/sda1
You are  tc/staff  and since  staff  has  rw  permissions set you can read and write to that device.

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
Re: how does hexedit change my boot record without sudo
« Reply #10 on: February 06, 2012, 02:30:58 PM »
Hi Lee
If the drive you wish to mount is listed in  /etc/fstab  and the fourth column (mount options) contains
the word  users , you don't need  sudo  to mount it, just  mount /mnt/sdb1  will suffice, as will
mount /dev/sdb1.

and Lee you can run mc go to /mnt/ select sda1 write "mount " [hit] Ctrl+Shift+Enter Enter Enter and you are in