
507 F.3d 603 (2007)
Carlos CURRY, Petitioner-Appellant,
v.
UNITED STATES of America, Respondent-Appellee.
No. 07-1658.
United States Court of Appeals, Seventh Circuit.
Submitted September 28, 2007.
Decided November 8, 2007.
Carlos Curry, Milan, MI, pro se.
Edmond E. Chang, Office of the United States Attorney, Chicago, IL, for Respondent-Appellee.
Before POSNER, KANNE, and ROVNER, Circuit Judges.
POSNER, Circuit Judge.
This appeal presents the recurring question of how the court of appeals should treat an appeal from the denial of a prisoner's *604 motion under Fed.R.Civ.P. 60(b) to vacate the denial of postconviction relief that he had sought under either the provisions of the federal habeas corpus statute applicable to state prisoners, 28 U.S.C. §§ 2244, 2254; or, if as in this case he is a federal prisoner, under 28 U.S.C. § 2255, the federal prisoners' habeas corpus substitute. There is quite a variety of answers on offer. See, e.g., United States v. Hardin, 481 F.3d 924, 926 (6th Cir.2007); Spitznas v. Boone, 464 F.3d 1213, 1218-19 (10th Cir.2006); United States v. Lambros, 404 F.3d 1034, 1036-37 (8th Cir.2005); Benchoff v. Colleran, 404 F.3d 812, 820-21 (3d Cir.2005); Reid v. Angelone, 369 F.3d 363, 374-75 (4th Cir.2004); Munoz v. United States, 331 F.3d 151, 153 (1st Cir.2003); Porter v. Adams, 244 F.3d 1006, 1006-07 (9th Cir.2001). But the answer given by this court, for example in United States v. Lloyd, 398 F.3d 978, 980 (7th Cir.2005), seems to us the best, and as it has not been fully explained in our previous decisions, we take this opportunity to do so.
Section 2244(b)(3) forbids a prisoner to file a second or otherwise successive petition for habeas corpus without his moving the court of appeals for permission; section 2255 ¶ 8 imposes a similar limitation on motions under that section. Section 2253(c) requires a prisoner to obtain a certificate of appealability, either from the district court or from this court, Dressler v. McCaughtry, 238 F.3d 908, 912 and n. 3 (7th Cir.2001), before he can appeal from a final decision in either "a habeas corpus proceeding" or, as in this case, "a proceeding under section 2255." It is the interaction between the limitation on successive petitions (or motions) and the appealability of denials of such claims that generates the question presented by the appeal.
Critically, it does not matter how the prisoner labels his pleading. Federal postconviction law is complex, and few prisoners understand it well. Often a prisoner will file a motion under Rule 60(b) of the civil rules, that is, a motion to reconsider a judgment, but the ground of the motion and the relief he seeks will mark the motion as functionally a petition for habeas corpus or a motion under section 2255, because it challenges the legality of his detention and seeks his release. If so, it will be treated as such. Gonzalez v. Crosby, 545 U.S. 524, 530-32, 125 S.Ct. 2641, 162 L.Ed.2d 480 (2005). "Prisoners cannot avoid the . . . rules [governing federal post-conviction remedies] by inventive captioning. . . . [T]he name makes no difference. It is substance that controls." Melton v. United States, 359 F.3d 855, 857 (7th Cir.2004). Similar issues of characterization arise when a prisoner brings a civil rights suit but actually is asking for relief available only under sections 2254 or 2255. Cochran v. Buss, 381 F.3d 637, 639-40 (7th Cir.2004); Montgomery v. Anderson, 262 F.3d 641, 643-44 (7th Cir. 2001).
If a Rule 60(b) motion is really a successive postconviction claim, the district court will lack jurisdiction unless the prisoner has first obtained our permission to file it. (If his pleading is a bona fide Rule 60(b) motion, the denial can be appealed, Gonzalez v. Crosby, supra, 545 U.S. at 532-34, 125 S.Ct. 2641, providedwe have held, though the issue has been left open by the Supreme Court, id. at 535 n. 7, 125 S.Ct. 2641  a certificate of appealability is issued. West v. Schneiter, 485 F.3d 393, 394-95 (7th Cir.2007).) But suppose the district judge does not spot the true character of the Rule 60(b) motion. He thinks it's a bona fide Rule 60(b) motion, denies it on the merits, and grants a certificate of appealability. But then we spot it as really a habeas corpus or section 2255 application that we had not permitted to be filed, permission never having been sought, as *605 required by section 2244(b)(3) (for habeas corpus) or section 2255 ¶ 8 (for motions under that section). Because a district judge lacks jurisdiction to rule on a successive such application without our permission, if he does so we must order his judgment vacated. United States v. Scott, 414 F.3d 815, 817 (7th Cir.2005); United States v. Lloyd, supra, 398 F.3d at 979-80; Melton v. United States, supra, 359 F.3d at 857-58 (7th Cir.2004); Dunlap v. Litscher, 301 F.3d 873, 876 (7th Cir.2002).
The present case is of this character. The district court denied the Rule 60(b) motion without the prisoner's having gotten our permission to file a successive section 2255 motion, even though it is apparent that he had mislabeled his motion and that it was really a section 2255 motion because it challenges his conviction and asks that he be released from custody and even though it is a successive such motionhe had filed at least a half dozen prior such motions.
Because the judge exceeded his jurisdiction, his decision must be vacated with instructions to dismiss the motion for want of jurisdiction.
