사용자 도구

사이트 도구


linux:ubuntu:samba

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
linux:ubuntu:samba [2022/04/13 15:54]
kwon37xi [mouting smbfs]
linux:ubuntu:samba [2022/04/13 16:04]
kwon37xi [mouting smbfs]
줄 58: 줄 58:
  
 ===== mouting smbfs ===== ===== mouting smbfs =====
-  * [[http://ubuntuforums.org/showthread.php?t=255872|[HOW TO] Mounting smbfs Shares Permanently - Ubuntu Forums]] 참조+  * [[https://support.zadarastorage.com/hc/en-us/articles/213024986-How-to-Mount-a-SMB-Share-in-Ubuntu|How to Mount a SMB Share in Ubuntu – Zadara Support]]
   * [[https://linuxhint.com/mount-smb-shares-on-ubuntu/|How to Mount SMB Shares on Ubuntu?]]   * [[https://linuxhint.com/mount-smb-shares-on-ubuntu/|How to Mount SMB Shares on Ubuntu?]]
  
-  * 기초 작업<code sh>+  * 기초 작업 
 +<code sh>
 # 패키지 설치 # 패키지 설치
-sudo apt-get install smbfs+sudo apt-get install cifs-utils
  
-# 계정정보와 비밀번호를 파일로 저장한다. 
  
-cd +sudo mkdir /mnt/share
-echo username=mywindowsusername > .smbpasswd +
-echo password=mywindowspassword >> .smbpasswd +
-chmod 600 .smbpasswd+
 </code> </code>
-  * ''/etc/fstab''<code> +  * credential 파일 생성및 권한 부여: ''.smbcredential'' 
-# root user only write/all read +<code text
-//servername/sharename /mountdirectory smbfs credentials=/home/myhomedirectory/.smbpasswd 0 0 +username=example_username 
- +password=example_password 
-# root user and specific user write/all read +</code> 
-# uid와 gid를 시해줘야 한다. +<code sh> 
-//servername/sharename /mountdirectory smbfs credentials=/home/myhomedirectory/.smbpasswd,uid=mylinuxusername,gid=mylinuxgroupname 0 0 +sudo chmod 400 /path/to/.smbcredential 
- +</code> 
-# 혹은 쓰기 권한을 줄 사용자를 특정 그룹에 지정하고, gid만 지정한다. +  령행 Mount 
-//servername/sharename /mountdirectory smbfs credentials=/home/myhomedirectory/.smbpasswd,gid=sambausersgroup 0 0+<code sh> 
 +sudo mount -t cifs -o rw,vers=3.0,credentials=</path/to/.smbcredential>\ 
 + //<share-pc-ip>/<share-dir> /mnt/share
 </code> </code>
-  * 명령어로 실행<code sh> +  * ''/etc/fstab'' 자동 mount 
-# smbmount 명령 사용하기 +<code sh> 
-smbmount //servername/sharename /media/mountdir -o credentials=/home/myhomedirectory/.smbpasswd+//<share-pc-ip>/<share-dir>  /mnt/share cifs vers=3.0,credentials=</path/to/.smbcredential> 0 0
  
-smbmount 명령은 uid,gid 지정이 안됐다. +username/password 직접지정 
-# mount 명령으로 uid,gid 지정 및 파일/디렉토리 모드 지정가능. 아래 예제는 Ubuntu에서 admin gid만 지정하고 읽기/쓰기 모두 가능하게 지정 +//<share-pc-ip>/<share-dir>  /mnt/share cifs vers=3.0,user=<user on VPSA>,pass=<passwd on VPSA> 0 0
-mount -t smbfs -o credentials=/home/myhomedirectory/.smbpasswd,gid=admin,file_mode=0660,dir_mode=0770  //servername/sharename /media/mountdir+
 </code> </code>
  
linux/ubuntu/samba.txt · 마지막으로 수정됨: 2022/07/21 22:49 저자 kwon37xi