Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2016
    Location
    Shanghai
    Posts
    82

    Question How to avoid inputing sudo -i every time during login SUSE 11 or 12


    Dear SUSE lovers,

    Need your help.

    I need to manage SUSE 11 or SUSE 12 servers everyday. But I find it is very boring when input sudo -i in every time during login SUSE 11 or 12 servers.

    For example:
    bsa3665:~> cat /etc/issue

    Welcome to SUSE Linux Enterprise Server 11 SP3 (x86_64) - Kernel \r (\l).

    bsa3665:~> sudo -i
    bsa3665:~ # id
    uid=0(root) gid=0(root) groups=0(root),112(sfcb)


    Is there any good idea for avoid inputting the command every time?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    4,031
    Sure.
    Use ansible/chef/puppet to manage your servers and git to keep your configuration outside of the servers.
    This way there is less need to login via ssh.
    You must always face the curtain with a bow.

  3. #3
    Linux Guru
    Join Date
    Dec 2013
    Posts
    2,747
    it's a feature, not a bug.
    security.

    also you don't need to be root all the time; you should actually make it a habit to NOT be root when it isn't required.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User CarterCox's Avatar
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    252
    If you are careful and can review all the code you run on your machine there is no problem to run everything as root.

    Although in theory you should review all the code you run anyways, since your home folder could still be affected even if you don't run anything as root.

    How is your sudoers file configured? Regardless of that, you could add this to /etc/sudoers (by running visudo as root):

    Code:
     ALL=(ALL) NOPASSWD: ALL
    And then add

    Code:
    sudo -i
    To ~/.bashrc (considering you use bash).
    "My common sense is tingling."

  6. #5
    Quote Originally Posted by Franklinhong View Post
    Dear SUSE lovers,
    Need your help.

    I need to manage SUSE 11 or SUSE 12 servers everyday. But I find it is very boring when input sudo -i in every time during login SUSE 11 or 12 servers.

    For example:
    bsa3665:~> cat /etc/issue

    Welcome to SUSE Linux Enterprise Server 11 SP3 (x86_64) - Kernel \r (\l).

    so since your paying for suse enterprise, did you call suse support?
    bsa3665:~> sudo -i
    bsa3665:~ # id
    uid=0(root) gid=0(root) groups=0(root),112(sfcb)

    Is there any good idea for avoid inputting the command every time?
    yea the 'good idea" is not be a total idiot and run as root. there is zero need to and you should avoid root like the plague, unless you have a really good reason. and you normally dont, because no one does. only a total moron would think there are no problems to running as root. people typically do this because they havent (yet) done something that nuked their entire system by accident, that they COULDNT HAVE DONE if they werent root. they then learn and dont do it again.

  7. #6
    Just Joined!
    Join Date
    Jul 2016
    Location
    Shanghai
    Posts
    82
    Quote Originally Posted by Irithori View Post
    Sure.
    Use ansible/chef/puppet to manage your servers and git to keep your configuration outside of the servers.
    This way there is less need to login via ssh.
    Hi Irithori,
    Got it. I think your idea is nice but in company our team doesn't have permission to access chef or puppet.

    Thanks,

  8. #7
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    4,031
    Using automation and versioncontrol for server management is not my idea.
    It is industry standard for at least a decade.
    You must always face the curtain with a bow.

  9. #8
    Quote Originally Posted by Franklinhong View Post
    Hi Irithori,
    Got it. I think your idea is nice but in company our team doesn't have permission to access chef or puppet.

    Thanks,
    so you dont have permission to do things, and your fix for that is to automatically log in as root? are you not keeping up with what your doing, since by logging in as root you can DO WHATEVER YOU WANT?

    pay attention: logging in as root or sudoing to a root level user is PLAIN STUPID, and shouldnt be done, ever, unless you absolutely need to. And 99% of the time, you DO NOT need to. Irithori is totally correct. ignore what CarterCock says, because if you do more than five mins of easy research you can go to google and see pretty much every *nix admin going back decades, telling people not to do this because its stupid on a galactic level.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •