su -c & Linux Certification
Certification, Linux November 5th, 2007
The purpose of the -c option with the su command allows you to execute only one line of commands as superuser before returning to the account of the former user.
The commands that follow must be enclosed in quotation marks if there are any spaces in the commands.
su -c "ls /root"
I’ve noticed that the -c option is often present in the correct answer on Linux Certification practice questions because it is a good security practice to use the lowest level of priviledge needed to complete a task.
Posts
Leave a Comment
You must be logged in to post a comment.