1. 在自己的主機上建立private key和public key
sway:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/sway/.ssh/id_rsa): (按Enter即可) Enter passphrase (empty for no passphrase): (按Enter即可) Enter same passphrase again: (按Enter即可)會在~/.ssh 產生兩個檔案,其中id_rsa.pub是public key,id_rsa是private key
2. 修改.ssh目錄權限
sway:~$ chmod 700 ~/.ssh
3. 複製public key到要登入的server上的~/.ssh/authorized_keys
sway:~$ cd ~/.ssh sway:~/.ssh$ ls id_rsa id_rsa.pub sway:~/.ssh$ scp id_rsa.pub sway@server:/home/sway/.ssh/authorized_keys sway@server's password: id_rsa.pub 100% 1675 2.5MB/s 00:00把public key傳上去之後,使用svn+ssh就不需要再輸入密碼了!
步骤2、3也可以通过 ssh-copy-id username@host_address 来完成
回覆刪除謝謝,感謝補充~
刪除