Financial terms were not disclosed, but CSNBayArea.com reports Scott will make $700,000.
Scott, 31, had one goal and 125 penalty minutes in 56 games with the Buffalo Sabres last season.
"John brings a physical, no-nonsense element to our lineup," Sharks general manager Doug Wilson said in a statement. "As we integrate more younger players to our team, John's presence alone can act as a deterrent and help keep teams and opposing players honest."
Fedun, 26, had two goals in four games with the Edmonton Oilers last season, and 10 goals and 38 points in 65 games with the Oilers' American Hockey League affiliate, the Oklahoma City Barons.
On his official Twitter account, Fedun wrote: "I am extremely excited and grateful for a new opportunity with @SanJoseSharks can't for September to roll around!"