How can I edit the /etc/ssh/ssh_config file?

I tried editing the /etc/ssh/ssh_config file on my Mac to change the forwardX11 from no to yes, and this to enable X11 features.

I try to change permission in the file ssh_config and in the folder etc, I did it, but in vain; still no permission to go inside the file to change something.


Solution 1:

I find the answer, with this line in Terminal :

sudo nano -w /etc/ssh/ssh_config 

Solution 2:

You should be editing ~/.ssh/config anyway. Modern versions of Mac OS will back out any changes you do to /etc/ssh/ssh_config upon reboot.