Writing malware is.. Well, there is a million ways to do it. That is why it is called malware; Malicious software.
Malware can be anything, the point is to get it installed on the machine (in most cases) and be able to use/misuse the information and or resources on a machine. To be honest, I havent written any linux malware, so I know very little about that. But I guess the idea is more or less the same; Find entry points on the system that will start your software when the machine starts. Registry entries, startup folders, config files, overwriting existing files that are started by default and so on. Then after you have mastered the code part, you will be interested in how to get it installed on the machine as root and implementing rootkits, hiding traffic, covert channels and so on.
Hope this gets you more or less started. If you have more specific questions, ill be here to answer.