To achieve SSH automatic login, there are three main methods: 1, the generation of public private key. 2, write expect script. 3, with Sshpass. Usage: Sshpass parameter SSH command (SSH,SFTP,SCP, etc.). Parameters: -p password//password The parameter as a password. -F passwordfile//Extract the first line of the file Passwordfile as a password. -E//Sshpass the environment variable as a password. For example: SCP Abc@192.168.0.5:/home/xxx/test/root The purpose of this command is to upload server-side file test to the local folder/root. Using Sshpass, assuming that the password is Efghi, you can write: Ssh-p Efghi SCP Abc@192.168.0.5:/home/xxx/test/root In addition, for SSH's first landing, will be prompted: "Are you sure your want to continue connecting (yes/no)", then use Sshpass will not work, the solution: 1. You can add-o stricth after the ssh command Ostkeychecking=no to solve. such as the above command, you can write ssh-p Efghi scp abc@192.168.0.5:/home/xxx/test/root-o stricthostkeychecking=no. 2. Or write the configuration file: The Stricthostkeychecking No add to/etc/ssh/ssh config can let SSH client automatically accept the new host Hostkey, do not have to input each time to compile arm version, in Sshpass Directory execution:./configure./make CC=ARM-LINUX-GCC Automatic file transfer:./sshpass-p 111111./scp-s/ssh-o. Stricthostkeychecking=no-r St.file testuser@192.168.0.10:./Sshpass relies on PTS, if PST is not loaded, execute Bash Code mknod-m 666/dev/ptmx C 5 2 #chmod 666/dev/ptmx mkdir/dev/pts #编辑/etc/fstab, join: none /dev/pts devpts gid=5, Mode=620 0 0 mount/dev/pts |