Explaining command su
Running a command with substitute user is the typical use of command su
under linux.
Sometimes, use -s
option to running the specified shell instead of the default, this option may helps a lot when need to access user whose default shell is /sbin/nologin
, usage like su -s /bin/bash jenkins
平时用的最多的倒是su - username