What is the difference between
ssh -Y (trusted X11 forwarding) and
ssh -X (untrusted X11 forwarding)? As far as I have understood it, it has something to do with security, but I did not grasp the difference and when to use which.
Both options have something to do with X11 forwarding. This means if you enable this you can use a graphical client through your SSH session (i.e. use Firefox or something else).
If you use
But if you use
If you want to know more about those things I suggest reading the Xsecurity manpage or the X Security extension spec. Furthermore you can check the options
Yes. -Y is for trusted X11 forwarding, while -X is for untrusted X11 forwarding. X11 forwarding just allows you to use X11 (i.e. graphical) applications over an SSH session.
I'm not sure what the meaningful difference is between trusted and untrusted X11 connections, but I'm sure it has to do with the server-side configuration (i.e. ssh-config, sshd-config, etc.). Check with your server or network admin about which flag to use.