Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Going in sudo syntax?


    I have a very elementary question about Linux. At my work we are migrating to SUSE distro. I was given sudo access to the Linux server use for DEV. I will just say the sudo account name is sysadmin.

    when I go into the sysadmin account i have to type:
    "sudo su - sysadmin"

    Can somebody explain why I have to put "su" after "sudo"? Is that just how SUSE syntax is? When I play around with the linux in my virtual box at home I just use command "sudo" and then the root user name.

    Also, is SUSE syntax of that there is a space after the -? because sudo su -sysadmin does not work but sudo su - sysadmin works.

  2. #2
    Linux Guru Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    2,183
    'sudo' - run something with elevated rights
    'su' - switch to another user, not necessarily root
    'su -' - switch also the environment
    'sysadmin' - in this case this is the user you are switching to

    That said, all this and much more can be learned by reading manual pages for sudo and su.

  3. #3
    Yes, I read and just could not find anything about the space after the dash adminName. I guess different distros of Linux has their own syntax. Thanks for showing me the difference between 'su' and 'su -'

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    2,183
    > space after the dash adminName

    Sorry, I have no clue what you mean by this.
    There is no difference between Linux distributions as long as the commands are considered. Where from did you get this idea?

  6. #5
    -->
    "..space after the dash adminName" was a misprint. I am still in learning curve of Linux.

Posting Permissions

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