Windows/MFC

SFU (Service for Unix) NFS Sever windows version

aucd29 2013. 10. 2. 18:36
http://wiki.tuxbox.org/NFS:SFU#Firewall_Einstellungen

[code]
netsh firewall add portopening protocol = TCP port = 111 name = "NFS-Portmapper 111 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1039 name = "NFS-Status 1039 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1047 name = "NFS-Nlockmgr 1047 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1048 name = "NFS-Mountd 1048 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 2049 name = "NFS-Server 2049 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 111 name = "NFS-Portmapper 111 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1039 name = "NFS-Status 1039 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1047 name = "NFS-Nlockmgr 1047 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1048 name = "NFS-Mountd 1048 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 2049 name = "NFS-Server 2049 UDP" mode = ENABLE scope = SUBNET profile = ALL
[/code]

소스 에디팅을 위해서 보통은 윈도우상에서 코딩을 주로 하고 있지만 소스 컴파일 자체는 리눅스에서 해야 하는 상황이 많기 때문에 윈도우 내에 NFS 서버를 두어 Linux 에서 NFS 로 소스를 접근 소스관리에 용이성을 제공하기 위해서 다음에 프로그램을 설치 할 수 있다.

1.1.    Download
2009년 9월 현재 Service for UNIX 에 프로그램 버전은 3.5 까지 출시 되어있고 무료로 다운로드 가능하다.

link : http://technet.microsoft.com/ko-kr/interopmigration/bb380242.aspx

1.2.    Installation
다운로드 후 압축을 푼다 그 후 SfuSetup.msi 를 선택해서 install을 진행한다.
기본적으로 Server for NFS 가 옵션에 제외되어 있으므로 사용자 설정으로 Install 을 진행 한 뒤 Server for NFS를 반드시 체크하도록 한다. 그 이후 설치는 default 설정으로 설치가 가능하며 설치가 잘못 되었을 경우 서버를 시작할 수 없는 상황이 발생할 수 있으므로 그럴 경우 제어판에서 프로그램을 제거 후 다시 설치하도록 한다.

1.3.    Setting
NFS 서버를 실행 시키기 위해서는 먼저 다음과 같이 진행하도록 한다.

1.    모든 서비스를 중단 한다. 중단 방법은 서비스를 선택 후 마우스 오른쪽 단추를 이용하여 Stop 하면 된다.

그림 1 Service stop and User Name Mapping

2.    User Name Mapping 을 선택한다.
3.    Radio button 으로 메뉴가 2개 있는데 Use Password and Group files 를 선택 한다.
4.    이후 연결할 Client Linux 에서 다음에 경로에서 사용자 정보 파일을 복사해온다 (/etc/passwd and /etc/group)
5.    passwd, group 파일을 임의의 위치에 복사한 뒤 User password and group 메뉴 에서 해당 경로를 지정하도록 한다.
6.    두 번째 탭인 Maps 를 선택 한다.
7.    하단에 Show User maps 를 선택 한다.
8.    Advanced maps 메뉴에서 먼저 Windows Users 창에 List Windows Users를 선택한 뒤 administrator 를 선택한다.
9.    이후 UNIX Users 란에 List UNIX Users를 선택 후 root를 선택한다.
10.    Add 버튼을 선택 한다.
11.    선택 후 Mapped users 선택한 정보가 추가되었는지 확인 한다.
12.    User Name Mapping 을 선택하여 Start 한다.


그림 2 Maps setting

13.    Service for NFS 를 Start 한다.
14.    공유할 폴더를 선택해서 마우스 오른쪽 버튼을 선택을 하게 되면 “공유 및 보안” 항목이 나타나게 된다. 이를 선택한다.
15.    전과 다르게 “NFS Sharing” 항목이 존재하게 된다 이를 선택한다.
16.    radio button 에 Share this folder 를 선택 한다.
17.    Share name 을 기입한다.
18.    Encoding 방식을 선택한다.
19.    Permissions 버튼을 선택한다.
20.    Type of access 를 Read-Write로 변경 한다.
21.    Allow root access 를 선택한다.

그림 3 NFS Sharing option

그림 4 NFS Share Permissions

22.    Windows XP 에서는 기본적으로 방화벽이 존재하므로 NFS 관련 Port를 열어야 한다. 다음에 코드를 윈도우 콘솔창에 입력한다. (copy & paste 가능)

netsh firewall add portopening protocol = TCP port = 111 name = "NFS-Portmapper 111 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1039 name = "NFS-Status 1039 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1047 name = "NFS-Nlockmgr 1047 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 1048 name = "NFS-Mountd 1048 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = TCP port = 2049 name = "NFS-Server 2049 TCP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 111 name = "NFS-Portmapper 111 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1039 name = "NFS-Status 1039 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1047 name = "NFS-Nlockmgr 1047 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 1048 name = "NFS-Mountd 1048 UDP" mode = ENABLE scope = SUBNET profile = ALL
netsh firewall add portopening protocol = UDP port = 2049 name = "NFS-Server 2049 UDP" mode = ENABLE scope = SUBNET profile = ALL

23.    예외 탭을 선택한다.
24.    포트 추가를 선택한 후 TCP 2049, 954, 138 번 이렇게 3개를 추가한다. (각각 따로)
25.    이제 Linux client 로 가서 nfs 연결 테스트를 해본다.
26.    mount –t nfs $(serverip):$(server_path) $(local_path)
예) mount –t nfs 192.168.1.58:/minpleT /home/public/nfs


http://ubuntuforums.org/showthread.php?t=310168
[edit]
Configure SFU


1. From Ubuntu copy /etc/passwd and /etc/groups to C:\

* You can read these files as Text so you may want to eliminate everything from passwd except the log-in names of your Linux users and everything from groups except users (I did).

2. Launch SFU

Start -> All Programs -> Windows Services for unix -> Services for Unix Administration

3. In the "Client for NFS (On the Left) set the desired permissions of the sharer (I chose rwx for owner and group, nothing for other)

* Click Apply

4. In the "User Name Mapping" (On the Left)

* Select "Use Password and Groups Files" -> Enter C:\passwd and C:\groups in the appropriate boxes

5. Maps Tab

* Select the "Show User Maps" -> Click "Show Windows Users" and "Show Unix Users"
o Select a Windows user and associate it with the appropriate Linux User (one who can normally mount the NFS Share on a Ubuntu Client)
o Click the "Add button"

* Select the "Show Group Maps" -> Click "Show Windows Groups" and "Show Unix Groups"
o I mapped Windows Administrators to Linux Users
o Click the "Add Button"

6. Back to configuration Tab

Click the "Apply" button on the top left Click the "Synchronize Now" button near the bottom