-->
  • Recent Articles

    How to sudo oracle access for users in Linux?

    How to sudo oracle access for users in Linux?

    sudo is used to elevate the privilege of the user who is running the command. We do have situations where we need to create a user who would access oracle and should not be able to root. To solve that situation we need to do the following.


    1. Create the user.
    useradd -c "Krishan, Rama" -s /bin/bash -G dba ramaK
    -c : Comments
    -s : Shell
    -G Group
    2. Edit the /etc/sudoers File. Add the alias "LIMITTHEDBA" and should have access to oracle "/bin/su - oracle". The "!/bin/su *root*" means the user shouldn't be able to switch to root.

    Cmnd_Alias LIMITTHEDBA = /bin/su - oracle, !/bin/su *root* --> add this in file
    All the "dba" group user, need not to give the password but  "LIMITTHEDBA" alias will come to effect.
    %dba ALL=NOPASSWD: LIMITTHEDBA --> add this in file

    Now Test the settings by switching the user.

    No comments