Protein folding and unfolding have been the subject of active research for decades. Most of previous studies in protein unfolding were focused on temperature, chemical, and/or force (such as in atomic force microscopy (AFM)) induced denaturations. Recent studies on the functional roles of proteasomes (such as ClpXP) revealed a different unfolding process in cell, during which a target protein is mechanically unfolded and pulled into a confined, pore-like geometry for degradation. While the proteasome nanomachine has been extensively studied, the mechanism for unfolding proteins with the proteasome pore is still poorly understood. Here, we investigate the mechanical unfolding process of ubiquitin with (or really outside) a generic nanopore, and compare such process with that in the AFM pulling experiment. Unexpectedly, the required force for protein unfolding through a pore can be much smaller than that by the AFM. Simulation results also unveiled different nanomechanics, tearing fracture vs shearing friction, in these two distinct types of mechanical unfoldings.