Ubuntu 16.04에서 sudo를 사용하여 MATLAB을 열 수 없습니다.

Ubuntu 16.04에서 sudo를 사용하여 MATLAB을 열 수 없습니다.

Ubuntu 16.04에 MATLAB R2017a가 설치되어 있습니다.

matlab콘솔에서 를 실행하여 소프트웨어를 성공적으로 시작할 수 있습니다 . 그러나 대신 실행하면 sudo matlab다음 오류가 발생합니다.

sudo: matlab: command not found

sudo su먼저 실행 한 다음 을 실행하여 동일한 응답을 얻었습니다 matlab.

없이만 실행할 수 있는 것이 어떻게 가능합니까 sudo? sudo업데이트할 특정 PATH 가 있습니까 ?

답변1

예, sudo자체적인 secure_path. 에서 man sudoers:

 secure_path   Path used for every command run from sudo.  If you don't
               trust the people running sudo to have a sane PATH environ‐
               ment variable you may want to use this.  Another use is if
               you want to have the “root path” be separate from the “user
               path”.  Users in the group specified by the exempt_group
               option are not affected by secure_path.  This option is not
               set by default.

(참고하세요.~이다Ubuntu의 기본값으로 설정됨 /etc/sudoers).

수정하기로 결정한 경우 visudo구문 오류가 발생할 경우 자신을 잠그는 것을 방지하기 위해 일반 편집기 대신 사용하는 것을 기억하십시오.

더 나은 옵션은 이미 Ubuntu에 있는 어딘가에서 심볼릭 링크를 만드는 것입니다 sudo secure_path.

$ ls -ld $(which matlab)
lrwxrwxrwx 1 root root 35 Apr 11  2017 /usr/local/bin/matlab -> /usr/local/MATLAB/R2017a/bin/matlab

matlab무엇보다도 루트로 실행할 필요가 없도록 장치 권한을 조정하는 것이 가장 좋습니다 .

관련 정보