Changing Identity(su command)

Posted on 2006-04-25
Last Modified: 2013-12-27
I am a new Solaris administrator. When you "su" to another person ex: (su - James).  What should I use the root password or my user password to assume a users identity. Neither have been working for me.

Question by:gumball60
    LVL 38

    Accepted Solution

    if you current login as user  gumball60, and do:
    su - fred
    you need to type in fred's password.

    if you login as root or su as root, then
    su - fred
    you don't need to give any password.

    su -

    from the current login change to "root", need to give root's password.

    man su
    to learn more details.
    LVL 10

    Expert Comment

    A little more detail that may be missed in the man page.

    Running "su - <ID>" will change to that user but also run that user's .profile/.cshrc or whatever.  The - symbol makes this happen.

    Just running "su <ID>" changes to that user but does not run that user's .profile/.cshrc or whatever.
    LVL 51

    Expert Comment

    to be more exact:
      su - ID  #  is identical to a login (see man su)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now