Announcement

Collapse
No announcement yet.

fdisk -l with and without sudo

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    fdisk -l with and without sudo

    In writing a bash script to mount and synchronize a USB flash drive to my desktop and my netbook, I've run across the following curiosity. Both desktop and netbook run Kubuntu 8.04.3. On the desktop, running
    Code:
    fdisk -l
    in Konsole returns a complete list of hard drive partitions and the attached USB device. On the netbook, the same command returns nothing. Only
    Code:
    sudo fdisk -l
    returns the list of partitions. It's not a big deal: I just have to enter my password when running the script on the netbook. But I'd like to know why the same command works without sudo on one machine and not on the other, when they have identical operating systems (kernels are the same, etc.). Could fdisk be hardware dependent? Any ideas?

    #2
    Re: fdisk -l with and without sudo

    I checked on both my laptop and desktop. I experienced the same result on both that you received on the laptop:
    Code:
    mike@racing$ fdisk -l
    mike@racing$
    It would seem to me that your experience on your desktop would be the different one. I don't think I could answer as to why, I would recommend writing the script to cover both.

    Mike
    http://monte48lowes.blogspot.com

    Comment


      #3
      Re: fdisk -l with and without sudo

      The behavior on your netbook is the default (normal user cannot use fdisk -l), I believe there are some security concerns involved.

      There are a few things you could check to find out the cause:
      1. Is your user in the "disk" group on the desktop (and not on the netbook)?
      2. Are the permissions/ownerships different for /proc/partitions on your desktop?

      Comment


        #4
        Re: fdisk -l with and without sudo

        Originally posted by kubicle
        The behavior on your netbook is the default (normal user cannot use fdisk -l), I believe there are some security concerns involved.

        There are a few things you could check to find out the cause:
        1. Is your user in the "disk" group on the desktop (and not on the netbook)?
        2. Are the permissions/ownerships different for /proc/partitions on your desktop?
        You hit it with #1. As I recall, I had to join the "disk" group in order to get my camcorder to connect via firewire, which I only do with the desktop. So, what security concerns should I have if I belong to "disk"? No one else uses the desktop.

        Comment


          #5
          Re: fdisk -l with and without sudo

          Originally posted by arist
          So, what security concerns should I have if I belong to "disk"? No one else uses the desktop.
          A user in the disk group has rw access to the disk devices...often not a big concern on single user machines, but can be a security issue.

          Comment

          Working...
          X