Not sure I understand the "save to the desktop" part? You want to put the output of ifconfig in a file on the desktop?
As for ssh, both the man page and google have heaps of insight into how to use it.
Generally we like to help when you are stuck after trying something and need a slight tweak. Also, as it is homework, most answers will probably be of the form, see link or man page.
So if you could answer my first question and then go with suck it and see with ssh on the command line, then it is trivial to place into a script (usually

)