# ssh



La configuration SSHD est stockée dans `/private/etc/ssh/sshd_config`

Pour démarrer ou arrêter SSHD:

```bash
sudo launchctl stop com.openssh.sshd

sudo launchctl start com.openssh.sshd
```

[source](https://superuser.com/questions/364304/how-do-i-configure-ssh-on-os-x/364370#364370)

```bash
# On crée un alias bash pour redémarrer sshd:
alias restartsshd='sudo launchctl stop com.openssh.ssh-agent; sudo launchctl start com.openssh.ssh-agent;' 

# Liste des services:
launchctl list | grep openssh
```



Changer le port ssh (22 par défaut) sur macOS:

[https://apple.stackexchange.com/questions/335324/cannot-change-ssh-port-on-high-sierra](https://apple.stackexchange.com/questions/335324/cannot-change-ssh-port-on-high-sierra)



**12.6.1 HTTPS vs SSH**

If you think you have SSH set up correctly and yet you are still challenged for credentials, consider this: for the repo in question, have you possibly set up GitHub, probably called origin, as an HTTPS remote, instead of SSH?

How to see the remote URL(s) associated with the current repo in the shell:

git remote -v

An SSH remote will look like this: git@github.com:USERNAME/REPOSITORY.git

whereas an HTTPS remote will look like this: https://github.com/USERNAME/REPOSITORY.git

You can toggle between these with git remote set-url:

- <https://help.github.com/articles/changing-a-remote-s-url/>



<https://apple.stackexchange.com/questions/225231/how-to-use-ssh-keys-and-disable-password-authentication>



