Retired Navy Cmdr. Walter C. Slye, 78, who served as a pilot or captain on yachts under four presidents, died Thursday at Bethesda Naval Hospital. He had lymphoma.

Cmdr. Slye was born at Bushwood in St. Mary's County, Md., and spent most of his life on the waters of the Potomac River and Chesapeake Bay.

His father, Chapman A. Slye, was the skipper of riverboats that plied the Potomac from Washington to Colonial Beach and other points and the future captain of presidential yachts used to work with him.

In the early 1920s, Cmdr. Slye went to Baltimore and became a pilot and captain in the steamboat division of the Maryland, Delaware and Virginia Railway Co. He served on boats sailing between Baltimore, Washington and Norfolk.

He began his naval career during World War II. In 1943, he went into the Navy as a warrant officer. He was sent to the Pacific and became harbor master at Guam.

Cmdr. Slye returned to the United States in 1946, and was thinking of leaving the Navy when he received a chance to serve as pilot aboard president Harry S. Truman's yacht, the Williamsburg. He took it.

When Dwight D. Eisenhower became president in 1953, one of the first things he did was order the Williamsburg put in mothballs. The yacht that Eisenhower used was the Barbara Anne, and Cmdr. Slye served as her captain. He continued in that post under president John F. Kennedy, who renamed the Barbara Anne the Honey Fitz in honor of one of his grandfathers.

Cmdr. Slye remained in command of the yacht under president Lyndon B. Johnson for a few weeks after Kennedy's assassination. Then he began his long-planned retirement at the end of 1963.

"It was a wonderful job," the commander told a reporter shortly before he left the service. "I loved it when the Eisenhower grandchildren and the Kennedy children were around. I remember one day, though, when a lot of the Kennedy children and other children were around, running all over. There were 14 kids aboard that 92-foot Honey Fitz. That could make your hair stand up a little bit."

After his retirement, Cmdr. Slye divided his time between his home in Washington and a residence on Herring Creek near Piney Point in St. Mary's County.He spent as much of his time as he could at Herring Creek, fishing and crabbing in waters he had known since childhood.

He was a member of the parish of St. Francis Xavier Catholic Church in Washington.

Survivors include his wife, Gertrude S., of the homes; two brothers, Harry E., of Bethesda, and William T., of Aquia, Va., and one sister, Valinda Rehbein, of Alexandria.