A Samba configuration management method for a network device, the method comprising: setting a share directory in an external storage device of the network device, adding information of the share directory into a configuration file of a Samba server, and storing the information of the share directory into a share backup file of the external storage device, wherein the information of the shared directory comprises a share path; when it is detected that the external storage device is removed from the network device, detecting and deleting the information of the share directory related to the external storage device from the configuration file of the Samba server; and when it is detected that the external storage device is inserted into the network device, detecting and reading piece by piece the information of the share directory in the related share backup file of the external storage device, and performing the following operations: reading a share path of the information of the share directory, modifying a disk symbol of the share path into a current disk symbol of the external storage device, judging whether a modified share path is existent, if the modified share path is existent, adding the information of the share directory into the configuration file of the Samba server, and if the modified share path is not existent, deleting the information of the share directory from the share backup file; when modifying a share path of the external storage device, modifying the information of the share path in the configuration file of the Samba server, and modifying the information of the share path in the share backup file of the external storage device. setting a share directory in an external storage device of the network device, adding information of the share directory into a configuration file of a Samba server, and storing the information of the share directory into a share backup file of the external storage device, wherein the information of the shared directory comprises a share path; when it is detected that the external storage device is removed from the network device, detecting and deleting the information of the share directory related to the external storage device from the configuration file of the Samba server; and when it is detected that the external storage device is inserted into the network device, detecting and reading piece by piece the information of the share directory in the related share backup file of the external storage device, and performing the following operations: reading a share path of the information of the share directory, modifying a disk symbol of the share path into a current disk symbol of the external storage device, judging whether a modified share path is existent, if the modified share path is existent, adding the information of the share directory into the configuration file of the Samba server, and if the modified share path is not existent, deleting the information of the share directory from the share backup file; when modifying a share path of the external storage device, modifying the information of the share path in the configuration file of the Samba server, and modifying the information of the share path in the share backup file of the external storage device.