1

when i am login in as local user in redhat linux and run command echo $ PATH it is showing me :/sbin: in my path, when i dont have any access to commands like fdisk. then why it is showing me :sbin: in PATH

  • Have you checked in the sbin folder to see if fdisk is there? Can you show the full output of echoing the PATH? – Peter David Carter Mar 31 '16 at 14:07
  • [tom@localhost ~]$ echo $PATH /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/tom/bin
    [tom@localhost ~]$ fdisk -l [tom@localhost ~]$ we can see /sbin is in path but i am not getting fdisk -l output
    – user577423 Mar 31 '16 at 14:20
  • If you navigate to the sbin directory can you copy and paste the path from the command line so I can see what it is in your installation? Also, can you run ls from the command line is the /sbin folder just to make sure fdisk is in there? – Peter David Carter Mar 31 '16 at 14:50
  • 1
    AFAIK - fdisk requires root permissions, so you should try with sudo fdisk -l, that is why you have sbin in the path - to have access to the commands - not meaning you have the required rights to execute it. And you should explain a bit more what does it mean "I don't have access to commands" - do you get an error message? If yes, please let us know. – Zina Mar 31 '16 at 15:48
  • Just checking back to see if the issue is solved now. Did any of the comments help? :) – Peter David Carter Apr 01 '16 at 14:35
  • hi zain if i use sudo fdisk -l as local user them it is asking me password for same user and not root password. then were is sercutity for server if a user can access fdisk /dev/sda and create a partion or delete partion. – user577423 Apr 03 '16 at 16:06
  • HI peter David i am sorry for late response. i am not able understand why is /sbin path is there in local user account. – user577423 Apr 03 '16 at 16:09

0 Answers0