I read a comedic science fiction novel as a kid, sometime in the early 1970's, in which a man is alone on an enormous (thousands of miles, as I recall) abandoned spaceship. It was very funny (and I realize it sounds a lot like the premise of Red Dwarf, but this was decades earlier). I can't remember much more, and haven't been able to find any clues as to the title. I did wonder if it might be "Venus on the Half-Shell" by Philip Jose Farmer/Kilgore Trout, so I bought a copy of that and skimmed through it, but I'm pretty sure that wasn't it after all.
Update: I finally figured it out. It's Bernhard the Conqueror by Sam Lundwall (DAW books, 1973).
Bernhard Rordin, Private E-1 in the Armed Forces of the Galactic Empire is serving a twenty year sentence on a prison planet nicknamed Ol’ Slow Death. One day the massive ship Refanut passes overhead. It’s hard to miss since it’s twenty thousand miles long.
A scoutship lands next to Bernhard. The man is looking for the Pleasure Palaces. He doesn’t know how much time has gone by and that they don’t exist anymore. When he dies Bernhard manages to get into his scoutship and get to the Refanut.
Now he runs into all kinds of bizarre adventures including coming across a door that’s in love with him that ends up putting him into a trash compactor. Also on board is Captain Superhawk and over six hundred officers.
They’re happy to see Bernhard because he’s the only Private they’ve seen and they divide up the time each has to abuse him. He eventually escapes to the Comet. Not much better there.