Edge computing is used to execute tasks submitted by various mobile applications. However, task offloading to the edge nodes iniatiated by the IoT nodes would cause insider-attack issues. Trust mechanism is an effective method to resist insider-attacks. A trust scheme usually needs a threshold to distinguish between normal nodes and malicious nodes. Unfortunately, how to reasonably determine the threshold of a trust scheme is still an open problem. In this paper, a novel trust scheme based on linear discriminant analysis (LDA) for edge computing is proposed to overcome this problem. First, the trust value of an edge node is calculated based on a trust factor matrix. Second, a difference function of classification model based on LDA is estanblished to to distinguish malicious nodes from normal nodes. Finally, the problem of maximizing the difference function is transformed into the problem of finding the optimal weight. To the best of our knowledge, this is the first work to integrate LDA to solve the problem of trust values’ classification. The simulation results show that our scheme can distinguish malicious nodes from normal nodes with an accuracy of more than 95%, which is much higher than other schemes.