A City of San Francisco administrator who refused to hand over administrative passwords to the city's network was sentenced to four years in state prison Friday.

Terry Childs was convicted in April of violating California's hacking laws after he refused to hand over administrative control to the city's FiberWAN network in July 2008.

He was sentenced Friday by Judge Teri Jackson, according to Erica Derryck, a spokeswoman for the San Francisco district attorney's office.

Although the city's network continued to run during the 12 days that Childs refused to hand over control, jurors found that by denying the city the administrative control to its own network, he had violated state law.

Childs defended his actions during a long court trial, saying that he was only doing his job, and that his supervisor, Department of Technology and Information Services Chief Operations Officer Richard Robinson, was unqualified to have access to the passwords. Childs eventually handed over the passwords to San Francisco Mayor Gavin Newsom.

Prosecutors characterized the former network administrator as a power hungry control freak who couldn't be managed.

His attorney, Richard Shikman, disagreed, saying that Childs is a "man of great character."

"He clearly is not a hacker. The state's case is based on a theory which needs to be tested on appeal," he said via e-mail. "The case stands as a metaphor for both human folly and human achievement."

Childs has already served 755 days in county jail, Derryck said.

That time served will be applied to his sentence, so Childs could be paroled within the next four to six months. He had faced a maximum sentence of five years in prison.

Childs may also have to cover the city's US$900,000 bill, spent on trying to regain control of its network. A hearing on financial penalties is set for August 13.

Robert McMillan covers computer security and general technology breaking news for The IDG News Service. Follow Robert on Twitter at @bobmcmillan. Robert's e-mail address is robert_mcmillan@idg.com