Closed zxrobin01 closed 12 months ago
Why do you want to do this? What is the use case?
Why do you want to do this? What is the use case?
In some situation the global firewall blocked port 445, so I need to use another port for SMB share.
I assume this is for remote shares. Would this be globally, or on a per share basis?
I assume this is for remote shares. Would this be globally, or on a per share basis?
In my country almost all network vendors block port 445 for security reason.
So you are trying to mount a remote share on a server that is at a remote site?
So you are trying to mount a remote share on a server that is at a remote site?
I'm tring to mount a remote share from my home to my parents home. The two places all have IPV6 access and can reach each other through IPV6. The only problem is that 445 port is blocked.
I need Add port settings for smb mount too. can you help me
You best option is to do port forwarding in your router.
The telecom service provider has blocked port 445 and must use other ports to forward, so you need to customize the port.Custom ports increase flexibility in using the software
You can do port forwarding in your router and get around this problem.
Port 445 is disabled on the Internet and can only be used on a local network. Now that the router mapping has been used, the remote SMB after the mapping is need to mounted, so you need to configure a port another not 445. Your plugin cannot configure ports, only mount remote SMB using the 445 default port. Understand?
I fully understand what you are saying, but it is not a feature I will be adding for the following reasons:
ok,thank you! I now modify the lib file each time to mount it, and modify it again after restarting.
/ Get the mount parameters based on the file system. / function get_mount_params($fs, $dev, $ro = false) { global $paths;
$rc = "";
if (($fs != "cifs") && ($fs != "nfs") && ($fs != "root")) {
$config_file = $paths['config_file'];
$config = (file_exists($config_file)) ? @parse_ini_file($config_file, true, INI_SCANNER_RAW) : array();
$discard = ((isset($config['Config']['discard'])) && ($config['Config']['discard'] == "yes") && is_disk_ssd($dev)) ? ",discard" : "";
}
$rw = $ro ? "ro" : "rw";
switch ($fs) {
case 'hfsplus':
$rc = "force,{$rw},users,umask=000";
break;
case 'btrfs':
$rc = "{$rw},noatime,nodiratime,space_cache=v2{$discard}";
break;
case 'xfs':
$rc = "{$rw},noatime,nodiratime{$discard}";
break;
case 'zfs':
$rc = "{$rw},noatime,nodiratime";
break;
case 'exfat':
$rc = "{$rw},noatime,nodiratime,nodev,nosuid,umask=000";
break;
case 'vfat':
$rc = "{$rw},noatime,nodiratime,nodev,nosuid,iocharset=utf8,umask=000";
break;
case 'ntfs':
$rc = "{$rw},noatime,nodiratime,nodev,nosuid,nls=utf8,umask=000";
break;
case 'ext4':
$rc = "{$rw},noatime,nodiratime,nodev,nosuid{$discard}";
break;
case 'cifs':
$credentials_file = "{$paths['credentials']}_".basename($dev);
$rc = "{$rw},**port=8889(add port here),**noserverino,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=99,gid=100%s,credentials=".escapeshellarg($credentials_file);
break;
case 'nfs':
$rc = "{$rw},soft,noac,noatime,nodiratime,retrans=4,timeo=300";
break;
case 'root':
$rc = "{$rw},bind,noatime,nodiratime";
break;
default:
$rc = "{$rw},noatime,nodiratime";
break;
}
return $rc;
}
For the current version, we can not set port for smb mounts. We can add port entry in samba-mount.cfg
Modify function "do_mount_samba" from "unassigned.devices/include/lib.php" file.