
다음 명령을 사용하여 루트로 실행되는 쉘 스크립트가 있습니다.
ssh remotehost 'su - user sh -c "source /home/user/.profile; <command>"'
다음과 같은 결과가 나타납니다.
bash: su - user sh -c "source /home/user/.profile; <command>": 해당 파일이나 디렉터리가 없습니다.
/home/user/.profile은 확실히 원격 호스트에 존재합니다. 무슨 일이야? .profile에 정의된 경로를 가져오는 다른 방법이 있습니까?