A Connecticut man was sentenced on Wednesday to eight months in prison for his part in a hacking scandal in which nude photographs of the actress Jennifer Lawrence and other celebrities were made public on the internet, according to the man’s lawyer.

The man, George Garofano, 26, had pleaded guilty in April to gaining access to about 240 Apple iCloud accounts and stealing users’ private information. He was one of four hackers involved in a 2014 phishing scheme that tricked people into revealing their usernames and passwords. The other three hackers have been sentenced.

Mr. Garofano’s lawyer, Richard Lynch, said that Judge Victor A. Bolden, who oversaw sentencing in the United States District Court in Bridgeport, Conn., gave his client a lighter sentence than prosecutors had requested. Prosecutors in the case had argued that Mr. Garofano should serve at least 10 to 16 months in prison, saying the hacking was a serious crime.

Mr. Lynch said he and his team asked the judge for a more lenient sentence: five months in prison and another five months of home confinement. “The judge listened,” he said. But, Mr. Lynch added, “it was a difficult case because of the number of victims.”