The Facts on File Encyclopedia of Word and Phrase Origins (1997) has interesting entries for both bum and hobo. With regard to bum, it observes:
No self-respecting hobo, or tramp, would allow himself to be called a bum, for the word has degenerated from its original meaning of "a vagabond" over a century ago, and today usually stands for a "moneyless, prideless, filthy, hopeless derelict and habitual drunkard." One working definition to distinguish between the three classes of vagabonds is that "a hobo will work, a tramp won't, a bum can't." Bum was first recorded in 1855, and during the Civil War was used to describe a foraging soldier. It appears to derive from two words: the German bummer, "a high-spirited, irresponsible person," and the old English word bum, which has for four centuries been slang for both "a drunk" and "buttocks."
And as for hobo:
The word hobo is of uncertain origin. Perhaps it derives from a once common greeting of vagabonds to each other: "Ho! Bo" (Ho! a form of "Hi!" and Bo meaning "guy or brother"). This seems to be the most popular explanation, but wandering *ho*meward *bo*und Civil War veterans have also been suggested, as have hoe boys who left the farm and were on the road. The word is first recorded in the American Pacific Northwest, about 1889.
All I can say about the homeward bound Civil War soldiers is that they either were taking their time or got terribly lost if they started for home in 1865 (at the end of the war), and didn't get noticed as "hobos" until 1889 in the Pacific Northwest.
The Dictionary of American Slang, Third Edition (1995) adds this gloss:
hobo n by 1889 A person who wanders from place to place, typically by riding on freight trains and who may occasionally work but more often cadges sustenance...[origin unknown; perhaps fr the call "Ho, boy," used on late-1800s Western railroads by mail carriers, then altered and transferred to vagrants; perhaps putative hoe-boy, a migrant farm worker in the West, who became a hobo after the harvest season]
Followup (9/15/14): Early Occurrences and Meanings of Bum and Hobo
The term bum used in the sense of "buttocks" goes at least as far back as Shakespeare; in A Midsummer Night's Dream (by 1596), Robin Goodfellow brags to Titania's fairies:
The wisest Aunt telling the saddest tale,
Sometime for three-foote stoole, mistaketh me,
Then slip I from her bum, downe topples she,
And tailour cries, and fals into a coffe.
As for bum in the sense of "layabout," John S. Hittel, The Resources of California: Comprising Agriculture, Mining, Geography, Climate, Commerce, etc. etc. and the Past and Future Development of the State (1863) provides closely related definitions for both bummer and bumming:
§ 267. Californianisms.—The Californians have introduced certain words into the English language, or at least have adopted them in common use in the state, and a list of them, with their pronunciation and definition may not be out of place here.
Bummer.—An idle, worthless fellow, who does no work and has no visible means of support. The word "loafer," like "lounger," does not designate the general conduct or permanent character of a man, but only a temporary idleness. A respectable, industrious man may become a "loafer" by making idle, impertinent visits in business places during business hours ; but the word "bummer" implies a low, lazy character. It is probably derived from the vulgar German words Bummeln and Bummeler, which are about equivalent to "loafer" and "loaf." Its origin has been attributed to Boehmen, the German name of Bohemia, a nation celebrated for the number of its sharpers and adventurers. The Gipsies are alled Bohemiens in France, because of their roving lives and worthless character. "Bummer" is generally supposed here to be a Californianism.
Bumming, acting the bummer, used in such phrases as "he is bumming around."
Fourteen years later John Bartlett, Dictionary of Americanisms, fourth edition (1877) offers a more extensive definition, whose initial wording appears to have been cribbed from Hittell:
Bummer. An idle, worthless fellow without any visible means of support. A word much used by our soldiers during the late civil war. The "New York Herald," May 2, 1876, thus describes the individual: The army bummer is usually a "General" who has been in the Quartermaster's or Commissary Department, and whose rank represents influence about the War Office, and days and nights of hard duty about Willard's and the Arlington. Since the war, he has been very "loyal." He has "sustained" the Union, and "supported the government. Unable to earn an honest living, without brains for any position higher than that of a car conductor, he lives by lobbying.He knows the inside of every office, the favorite wine of a secretary, and the kind of dinner fancied by this statesman or the other. So, in time, he finds himself in the enjoyment of a good income, for which he does nothing but eat and drink and talk. He is a disgrace to the army, whose uniform he wears for his own gain.
Notwithstanding the opening words appropriated from Hittel's definition, Bartlett's definition clearly identifies a bummer as a sycophant in search of a sinecure. But this meaning has largely died out, while Hittel's "Californianism" notions of bummer and bumming remain largely current in the words bum and bumming.
The word bummer appears on two occasions in Harper's New Monthly Magazine during the year 1864. First, in "Editor's Drawer" in the August 1864 issue, this vignette involving Bill, "a returned Californian, who pretended to have made his pile in the land of the gold":
Just then the boys, who were lying in wait to see the fun, exploded, and the shout which accompanied their yells of laughter—"Old Mose has sheared the wrong hoss!"—was a sufficient explanation of the matter. Bill had hired old Mose, a regular old bummer, to shear the parson's horse ; and being both in the same barn, and both harnessed, he very naturally made a mistake, of which Bill has not heard the last to this day.
And from "How We Fight at Atlanta" in the October 1864 issue:
Besides the fighting population of our camps there is a population constitutionally opposed to warfare—cooks, ambulance nurses, stretcher-bearers, shirks, and sometimes surgeons, who all come under the class technically called bummers. These are treated by the fighting men with a sort of cool contempt, no matter whether necessity or inclination keeps them to the rear, and they have a hard time. Frequently the rear of the army is a much more dangerous location than the front line, for the missiles passing over the front line must fall somewhere, and often demoralize whole hosts of "bummers," who build up miniature fortifications to live in and collect together in crowds ; for misery loves company. Any favorable ravine thus peopled immediately becomes denominated “Bummer's Roost." Here they spend their days in cooking for their nurses, if they are cooks, or attending to their own business, if their object be to escape duty and danger.
To watch these cooks, freighted with the precious coffee for the men in the trenches, as they go out to the front three times a day, is amusing. From continually dodging the passing shells or stray bullets their forms become bent and stooping. As they approach the line, the men in the trenches commence shouting. "Hey, bummer! Run quick, bummer! "A man was killed just there, bummer!" With such encouragements the coffee at last reaches its destination, and being distributed among the eager men the bummer is soon at liberty to hurry back to the "Roost."
One possible source of bum in the "hanger-on" or "follower" sense is English north country speech. From John T. Brockett, A Glossary of North Country Words, in Use (1829):
BUM, s. the assistant or follower of a bailiff. Dr. Johnson has bum-bailiff, a well-known name for an unpopular officer of the law ; but the north country bum, is a distinct personage, following and assisting the bailiff. It may be, as has been conjectured, from bound ; though more likely, I think, from bum, the buttocks ; a word which "the poet of all nature" disdained not to use when he thought it most expressive to designate this very delicate part of the human body by one of its right English names.
One early discussion of the phrase "on the bum" suggests how the phrase can mean either "living a drifter's life" (when spoken of people) or "cheap and likely to break" (when spoken of machinery). From "Correspondence" in Stove Mounters' Journal (March 1903):
I have heard members say when they see a brother with cheap clothes on, "he looks on the bum.” and when they get a cheap stove to mount they say "its on the bum.” and so on. Why don't some one say a cheap organization is on the “bum." We are handicapped on account of a small fund, and if we could have a larger fund we certainly could better our condition; and if we can pay higher dues and don't pay them, thereby preventing the growth and prosperity of our international. I say our organization is on the "bum." And if we don't pay our executive officers more money than they can make in a shop why these positions will be on the "bum," and before long nobody will accept these positions unless he is on the "bum."
As for the earliest meaning and possible origin of hobo, Nathan K Griggs, Lyrics of the Lariat: Poem With Notes (1893) provides the following note to accompany his poem "Hobo's Lament":
The origin of Hobo, the term now so generally applied to the railroad grader, is unknown, but i generally supposed to have come from the salutation of "Ho, boy!" which was shouted by one workman to another, and finally shortened into the name now in common use. The Hobos are enlisted, so to speak, by labor agents, in the larger of the western cities and shipped, in car-loads, to the points where wanted. Naturally, as may well be imagined, the Hobo-car, long ere it reaches its destination, is redolent of odors not of those which are said to be clinging to the garments of the fair daughters of Farina. The Hobo is, or soon becomes, a queer type of humanity. Earning good wages, he toils contentedly on, despite rain and mud, till the monthly pay-day comes. Then he takes a lay-off for the purpose of spending his wealth, at which he is a phenomenal success. Indeed, as illustrative of this assertion, mention is here made of the fact that, upon one occasion, where a large number of such laborers were given their pay-checks, ninety per cent. of their entire earnings was held and owned by the adjacent saloons, dens of infamy and gambling hells, before the next sunrise. After a reasonable time spent in such debauchery, they are willing again to return to work, seemingly only hoping for another pay-day to arrive, to bring with it a repetition of its insane orgies and fancied delights.
In Griggs's poem, the hobo of the title is on foot, "hitting the trail, with usual zeal, To get to the East, to rustle a meal." The author describes him in consecutive stanzas as "this sorry Hobo," "this silly Hobo," "this luny Hobo," "this crazy Hobo," "this bummy Hobo," and "this busted hobo." So even though Griggs explicitly identifies hobos as working men (albeit as itinerant workers), he also associate them with impoverishment and irrational behavior and with adjectives from "sorry" to "bummy" to "busted."
Owen Wister, "The Evolution of the Cow-Puncher," in Harper's New Monthly Magazine (September 1895) identifies the hobo as being out of work more often (and more characteristically) than in work:
No one has accounted to me for hobo. A hobo is a wandering unemployed person, a stealer of rides on freight- trains, a diner at the back door, eternally seeking honest work, and when brought face to face with it eternally retreating. The hobo is he against whom we have all sinned by earning our living. Perhaps some cowboy saw an Italian playing a pipe to the accompaniment of a harp, and made the generalization: oboe may have given us hobo. Hobo-ken has been suggested by an ingenious friend; but the word seems of purely Western origin, and I heard it in the West several years before it became used in the East.
On the whole, Griggs's derivation of hobo from "Ho, boy" seems somewhat more plausible to me than Wister's derivations of the word from oboe and Hoboken.