Linux Fundamentals

i can't find out answer for "Which option needs to be set to execute a command as a different user using the "su" command? (long version of the option)"
even i have tried -l, --login and many more but don't reach there.

Comments

  • I am not sure what the answer to this is, as I haven't really looked at the academy stuff.

    However, to switch to a different user, you'd normally use:
    su username

    The -l / --login is focused on how the shell is built.

    If you want to run a command as a different user, then it is slightly different. You aren't switching, you just want a command to run. Re-read the man page.

    Note: I am not going to be available much in September.

    TazWake

    Note: https://www.nohello.com/

    Happy to help people but PLEASE explain your problem in as much detail as possible! If you say vague things like "It's not working", I cant help. This isn't Twitter so my DMs are always open.

  • I just did this. What I did was run the "man su" to search for command.

    Its asking for -c or --command

  • edited May 25

    Type your comment> @Laughingg said:

    I just did this. What I did was run the "man su" to search for command.

    Its asking for -c or --command

    May be its --command

  • @HAKSEC403 said:

    Type your comment> @Laughingg said:

    I just did this. What I did was run the "man su" to search for command.

    Its asking for -c or --command

    May be its --command

    Either should work.

    Note: I am not going to be available much in September.

    TazWake

    Note: https://www.nohello.com/

    Happy to help people but PLEASE explain your problem in as much detail as possible! If you say vague things like "It's not working", I cant help. This isn't Twitter so my DMs are always open.

Sign In to comment.