Sudoedit
sudoedit vs sudo vim
sudoedit specifies sudo with the -e
option. From the man page:
-e The -e (edit) option indicates that, instead of running a command, the
user wishes to edit one or more files. In lieu of a command, the string
"sudoedit" is used when consulting the security policy. If the user is
authorized by the policy, the following steps are taken.
따라서 시스템 관리자는 특정 명령이나 일반적으로 모든 파일이 아닌 특정 파일 편집에 대한 sudo 권한만 허용할 수 있습니다. 이를 통해 관리자는 사용자(또는 사용자 그룹)가 상승된 권한으로 편집할 수 있는 파일을 제어할 수 있습니다.
또한 사용자는 관리자가 지정한 편집기가 아닌 선호하는 편집기를 계속 사용할 수 있습니다.
또한 이 편집기를 사용자 자체로 실행합니다. 즉, 예를 들어 사용자가 .vimrc
에 지정한 모든 옵션이나 명령이 적용됩니다.