How Can I Remotely Access SMB Services via DDNS?

SMB, AFP, NFS, FTP, WebDAV, Rsync
Post Reply
User avatar
TMzethar
TerraMaster Team
Posts: 1223
Joined: 27 Oct 2020, 16:43

How Can I Remotely Access SMB Services via DDNS?

Post by TMzethar »

Applicable versions:
All versions

Applicable models:
All TNAS models

Operation steps:

1. SSH login to the TNAS device:

1.1 Visit the following link and follow the instructions to log in to the TNAS device via SSH: https://forum.terra-master.com/cn/viewt ... =79&t=1511

2. Edit the SMB configuration file:

2.1 In the SSH session, enter the command "vi /etc/samba/smb-extend.conf" and press Enter to open the SMB configuration file.

2.2 Press the "i" key to enter edit mode.

2.3 Use the arrow keys to move the cursor to the end of the file and add a line: "smb ports = port" (replace "port" with the SMB port you want to set).
Image

2.4 Press the ESC key to exit edit mode, and then press "Shift" + ":". After the colon ":" appears, type "wq" and then press Enter to save the configuration and exit.

2.5 Enter the command "/etc/init.d/samba restart" to restart the SMB service.

3. Configure router port forwarding:

3.1 Log in to your router's management interface.

3.2 Find the "Port Mapping" or "Port Forwarding" settings option.

3.3 Create a new port forwarding rule to forward the external access port to the SMB port on the internal IP address of the TNAS device.

4. Run the SMB configuration script:

4.1 Download the file from the following link to your Windows desktop: https://download2.terra-master.com/smb.bat

4.2 Right-click the downloaded script file and select "Run as administrator."

4.3 Follow the prompts, enter the domain name or public IP address bound to your TNAS device as prompted, and press Enter to continue. Then, enter the SMB port number you set in Step 2 and press Enter to confirm.
Image

4.4 After the script runs successfully, restart your computer.

5. Configure the hosts file:

5.1 Open File Explorer and navigate to C:\Windows\System32\drivers\etc\hosts.

5.2 Right-click the hosts file, select "Open with," and then use a text editor (such as Notepad) to open it.

5.3 Add a rule at the end of the file in the format: 127.0.0.1 domain name.

5.4 Save and close the hosts file.

Note: After completing step five, you can access it by entering "\domain address\folder name" in Windows' "Run" menu (shortcut: Windows key + R key). If you do not perform Step 5, you can only access it by entering "\127.0.0.1\folder name".
To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
Post Reply

Return to “File Service”