Abstract: A method for sharing a configuration file is applicable to a first host and a second host that are connected to a network, wherein the first host is electrically connected to the first peripheral device, and the second host is electrically connected to the second peripheral device. The method for sharing a configuration file includes: the first host starts the embedded program, and after obtaining the first public key of the first peripheral device, the embedded program is communicatively connected to a server, and the device requests a private key according to the first public key. After obtaining the private key, the embedded program uploads a configuration file, and the second host starts the embedded program.