31 lines
No EOL
1.9 KiB
Text
31 lines
No EOL
1.9 KiB
Text
= Permission denied (publickey)
|
||
Mengutip dari salah satu [[https://askubuntu.com/a/16665 | jawaban]] di AskUbuntu, SSH sangat pilih-pilih terhadap permisi folder `.ssh` dan file `authorized_keys`.
|
||
```
|
||
sudo chown -R username:username /home/username/.ssh
|
||
sudo chmod 0700 /home/username/.ssh
|
||
sudo chmod 0600 /home/username/.ssh/authorized_keys
|
||
```
|
||
= Menyalin kunci ke peladen
|
||
Dari manual ssh-copy-id:
|
||
|
||
```
|
||
NAME
|
||
ssh-copy-id — use locally available keys to authorise logins on a remote machine
|
||
|
||
SYNOPSIS
|
||
ssh-copy-id [-f] [-n] [-s] [-i [identity_file]] [-p port] [-o ssh_option] [user@]hostname
|
||
ssh-copy-id -h | -?
|
||
|
||
DESCRIPTION
|
||
ssh-copy-id is a script that uses ssh(1) to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you've done some
|
||
clever use of multiple identities). It assembles a list of one or more fingerprints (as described below) and tries to log in with each key, to see if any of them are already in‐
|
||
stalled (of course, if you are not using ssh-agent(1) this may result in you being repeatedly prompted for pass-phrases). It then assembles a list of those that failed to log
|
||
in, and using ssh, enables logins with those keys on the remote server. By default it adds the keys by appending them to the remote user's ~/.ssh/authorized_keys (creating the
|
||
file, and directory, if necessary). It is also capable of detecting if the remote system is a NetScreen, and using its ‘set ssh pka-dsa key ...’ command instead.
|
||
```
|
||
|
||
Skrip ini menginstal kunci SSH pada server sebagai kunci resmi. Tujuannya adalah untuk menyediakan akses tanpa memerlukan kata sandi untuk setiap login. Hal ini memfasilitasi login otomatis tanpa kata sandi dan sistem masuk tunggal menggunakan protokol SSH.
|
||
|
||
```
|
||
ssh-copy-id -i ~/.ssh/mykey user@host
|
||
``` |