![터미널 대신 fstab을 사용하여 마운트](https://linux55.com/image/137382/%ED%84%B0%EB%AF%B8%EB%84%90%20%EB%8C%80%EC%8B%A0%20fstab%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EB%A7%88%EC%9A%B4%ED%8A%B8.png)
다음과 같이 Ubuntu 컴퓨터에서 터미널을 사용하여 공유 드라이브를 마운트했습니다.
sudo mount -t cifs -o "username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g)" //server-address/folder /mount/path/on/ubuntu
/etc/fstab
위와 같이 자동으로 uid와 gid를 얻는다는 점을 염두에 두고 영구적으로 설치하는 방법을 알고 싶습니다 .
답변1
이와 유사한 구문은 fstab
요청한 항목을 생성하는 작업을 수행합니다.
//server-address/folder /mount/path/on/ubuntu cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0770,dir_mode=0770,uid=1001,gid=1001 0 0
/root/.smbcredentials
인증 자격 증명을 숨기려면 이 파일을 사용하는 것이 좋습니다 .
문제에 대해 명령을 실행한 후 mount 명령을 실행하여 대략적인 구문을 확인할 수도 있습니다.
관련 항목을 참조하세요: CIFS는 Windows 공유에 대한 연결이 임의로 끊어집니다.