Post on 25-Feb-2018
transcript
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 1/18
• Ubuntu
• Community
• Ask!
• Developer
• Design
• Hardware
• Shop
• More ›
Stack changesign up log in
Ask Ubuntu
• "uestions
• #ags
• #our
• Users
• Ask "uestion
#ell me more $Ask Ubuntu is a %uestion and answer site &or Ubuntu users and developers' (t)s *++, &ree- no
registration re%uired'
How do I reset a lost administrative
password?
up vote ..down vote&avorite 53
()m working on a Ubuntu system using a /anasonic C012+ 3aptop' My Clienthas completely &orgotten his Administrative /assword' He doesn)t evenremember entering one4 however it is there'
()ve tried the suggestions on the 5ebSite and ( have been unsuccess&ul in
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 2/18
deleting the password so that ( can download applets re%uired &or running some&iles' Do you have a solution6 ( look &orward to hearing your response'
password
shareimprove this %uestion
edited Sep *7 )*8 at 9:8;
Sergey*<'9k8;;<
asked =an 9+ )** at *;:2+user77+;
reboot the machine in single user mode' debuntu'org>recover1root1password1single1user1mode1and1grub ? aspit@er =an 9+ )** at *;:27
#ry &ollowing these instructions: psychocats'net>ubuntu>resetpassword ? csgeek May *8 )*8 at 8:;
13 Answers
active oldest votes
upvote*+.down
vote
By de&ault the &irst user)s account is an administrative account- so i& the U( is promptingyou &or a password it)s probably that person)s user password' (& the user doesn)tremember their password you need to reset it' #o do this you need to boot into recoverymode'
Boot up the machine- and after the B(S screen- hold down the le&t Shift key' ou willthen be prompted by a menu that looks something like this:
()ve noticed on some systems that timing when to hit the le&t Shift key can be tricky-
sometimes ( miss it and need to try it again'
Hit the down arrow until you select the 8nd entry &rom the top Ethe one with the
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 3/18
recovery mode in the descriptionF and then hit Enter'
Gow you should see this menu:
Using the arrow keys scroll down to either root or netroot Edoesn)t matter in this caseFand then hit Enter'
ou should now see a root prompt- something like this:
root@ubuntu:~#
At this stage it is possible you have a read1only &ilesystem' ou have to remount it withwrite permissions:
mount -rw -o remount /
Gow we can set the user)s password with the passwd command' E(n this eample ( will
use orge as the eample- you need to substitute whatever the user)s username isF:
passwd jorgeEnter new UNIX password:et!pe new UNIX password:passwd: password updated su""essfu!root@ubuntu:~#
#ype in what you want the new password to be at the prompt' A&ter it)s success&ul
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 4/18
reboot the machine and the user will be able to log in with their new password'
• Iecovery Mode documentation
• 3ost password documentation
shareimprove this answer edited Aug 8+ )*8 at *<:++
answered =an 9+ )** at *<:+9
=orge Castro89'8k2+88*;;2
( ust tried it and passwd username worked' ()m very surprised' 5hy is this not
considered a security issue6 Eespecially &or desktop /CsF ? Mohamed Meligy Sep89 )*8 at 2:;8
*9(t isn)t a security issue- because you still have to be sitting in &ront o& the machineto do this' And i& you have physical access to the computer you can do prettymuch anything to it anyway' ? Bobble ct 9 )*8 at +:2*
9
=ust to &ollow1up on Bobble)s correct comment: i& you have physical access to amachine- you can take the disk out and mount it on a totally separate systemwhere you do have root' =ust as one eample' #he only protection against &ull datacompromise in the &ace o& physical access is strong disk encryption' ? ariel& Mar 9at *7:27
( had to go the route o& editing the boot command' But your note here about
remounting was the bit ( was missing' Here is how to edit the boot command:makeuseo&'com>tag>how1to1reset1any1linu1password ? Chrono0ish May *< at*:88
upvote*.downvote
es you can change the old password via Jrub
*' (& you have a single1boot EUbuntu is the only operating system on yourcomputerF- to get the boot menu to show- you have to hold down the Shi&t keyduring bootup
8' (& you have a dual1boot EUbuntu is installed net to 5indows- another 3inuoperating system- or Mac S K4 and you choose at boot time which operatingsystem to boot intoF- the boot menu should appear without the need to holddown the shi&t key
9' 0rom the boot menu- select recovery mode- which is usually the second bootoption'
;' A&ter you select recovery mode and wait &or all the boot1up processes to &inish-you)ll be presented with a &ew options' (n this case- you want the Drop to root
shell prompt option so press the Down arrow to get to that option- and then
press nter to select it
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 5/18
2' nce you)re at the root shell prompt- i& you have &orgotten your username aswell- type s /home Esmall letters L not capitalsF' #his will list all the user
accounts in your set up'
' #o reset the password- type passwd username where username is the usernameyou want to reset eg' passwd m!sterio in my case
<' ou)ll then be prompted &or a new password' 5hen you type the password youwill get no visual response acknowledging your typing' our password is still
being accepted' =ust type the password and hit nter when you)re done' ou)ll be prompted to retype the password' Do so and hit nter again'
.' Gow the password should be reset' #ype e$it to return to the recovery menu'
7' A&ter you get back to the recovery menu- select resume normal boot - and useUbuntu as you normally wouldonly this time- you actually know the
password!
Hope this helps' Sorry ( couldn)t add images as ()m on my phone
shareimprove this answer
edited Apr * )*8 at ;:*<
Alaa<;9*9
answered Mar 9* )*8 at 8*:;7
Mysterio8-279;99<;
#his o&&ers a route &or when you &orget both userid and password- which would alsowork with N=orge Castro)s answer' ? Bobble ct 9 )*8 at +:27
upvote**downvote
(& =orge)s method didn)t work &or you- as it didn)t &or me- here is another method' ( hadto try something di&&erent because:
*' My USB keyboard did not work at the root prompt⋯ probably hardwareeither keyboard or mainboard' #he &i ( used was &ind an old /S>8 keyboardEthe little round plugF and use that'
8' 5hen ( used passwd username to change my password- it &ailed because o& a
bad token or such' #his called &or drastic measures'
The Drastic Measures
This is a very dangerous thing to do! =orge)s method should be used4 only do this incase that method doesn)t work'
Do this at your own ris ' (t did work &or me on my **'*+ system'
#he idea is to set the user)s password to blank Eor nullF 1 this allows you to ust press
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 6/18
Enter at the %assword: prompt'
Still at the root prompt &rom =orge)s method- &irst remount the root &ile system as read1write by using this command:
mount -o remount&rw /
• Gow you are a super1user on this system' Tread lightly.
#hen edit the password shadow &ile to remove the encrypted password &or yourusername' #ype inO
nano -' /et"/shadow
#he nano editor will display the contents o& the &ile' ach line will have the &orm
name:⋯:⋯:⋯( where⋯ is a string or null EemptyF' ne o& the lines will start withyour username' #he &irst⋯ a&ter your username is your encrypted password' As an
eample:
username:)*)am+eN"jp)%prj,E.0Ut1w2fE3456:*7896:6:88888::::
where )*)am+eN"jp)%prj,E.0Ut1w2fE3456 is the encrypted password'
Care&ully delete the encrypted password leaving the all the P:Ps- so it looks like this:
username::*7896:6:88888::::
#hen type trl"#- hit the enter key to save- then trl"$ to close nano'
Ieboot and you will have an empty Eor nullF password' Be sure to use passwd
username in a terminal to set or reset your user password'
Source &or /S>8 workaround was here'
Sources &or the drastic measures were here and here'
Gote on nano Q the -' option makes a backup o& the original edited &ile- same namewith aPRP appended'
share improve this answer
edited Mar 9+ )*8 at +:;+
David<28;8*
answered Dec 8 )** at 8+:22
keepitsimpleengineer *-9.*+9*
8ou can also use this method by booting with a di&&erent disk and editing
>etc>shadow a&ter mounting the appropriate disk' ? David Mar 87 )*8 at 89:28
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 7/18
upvote*+down
vote
Ubuntu does not come with an ;dministrati<e password' #here is only one initial
account- the user account- which can be used to eecute administrative tasks' 0oreample- to get a root shell you run
) sudo -i=sudo> password for m!usera""ount: # here !ou t!pe the user?spassword#
A lot o& people that have Uni background or eperience with other distributionsstumble on this issue %uite o&ten'
#he command
su
will always &ail because the root account is locked4 it cannot be accessed directly or
you cannot login directly to root'
#here are great advantages in using the sudo &acility'
shareimprove this answer
edited *< hours ago
guntbert8-;;28<8
answered =an 9+ )** at *2:2.
user;*8;;-+;<<8*
( pre&er sudo -s to sudo su -' & course- i& you need Proot login shellP- then do
sudo su - root by all means' ? Mikko Iantalainen Dec *8 )*8 at *+:+2
NMikkoIantalainen- ( ust changed the sudo command above- your comment might be obsolete now :1F ? guntbert *< hours ago
up vote< downvote
( was able to use =orge)s method 1 the one above with the nice screen shots 1 with a&ew minor changes' ()m using Ubuntu **'*+
0irst- when booting up 1 don)t press the le&t shi&t key until the B(S screen goes black and then immediately press and hold the le&t shi&t key'
#hen- a&ter perhaps a minute and a number o& lines o& tet scroll on the screen- ( gotthe &irst menu- but with a couple o& &ewer lines 1 ( chose the second line'
#hen ( got the Iecovery Menu 1 but when ( chose Drop to Ioot Shell /romptEbottom itemF ( was root but couldn)t reset the password 1 because the disks wereIead nly' #ype eit and get back to the Iecovery Menu
#here was a choice Enot shown on =orge)s screen shotF to Iemount Iead>5rite Used
the down arrow to go to it- then le&t arrow to get to and nter 1 and it mounted the
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 8/18
disk I5'
#hen again to Drop to Ioot Shell /rompt and ()m root and can write 1 so passwdusername had me enter the desired password twice 1 then eit to go back to
Iecovery Menu Iesume normal boot and everything worked &ine with my new password! ()m the only account on this bo- and my password works with sudo so (apparently have Administrative /rivileges'
#his was less eciting than editing >etc>shadow but ( was glad to trade theecitement &or a nice ending'
share improve this answer
answered =an * )*8 at 9:*;
Henry Scha&&er <***
up vote2 downvote
(& you &orgot you password &or your Ubuntu system you can recover using the&ollowing steps:
*' #urn your computer on'
8' /ress ES, at the grub prompt'
9' /ress e &or edit'
;' Highlight the line that begins erne - press e
2' Jo to the very end o& the line and add rw initA/bin/bash
' press enter- then press b to boot your system' Your system will boot up to a
passwordless root shell.1
<' Gow issue the command passwd username *where "username" is the user for which you want to change the password.
.' #hen you will be asked to give new password:
Enter new UNIX password:
1Source:ubuntugeek
ther Iesources:
Ubuntu Documentations
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 9/18
Ubuntu Help
/sychocats
shareimprove this answer
edited Apr 8 at 7:2
Iadu Maris898*9
answered =ul *. )*8 at *7:22
Mitch*2'k822*
#he / may not know what to do at the shell' ? bsessiveSSℲ =ul *. )*8 at 8+:*+
upvote ;
downvote
0irst- you have to reboot into recovery mode'
(& you have a single1boot EUbuntu is the only operating system on your computerF- toget the boot menu to show- you have to hold down the Shi&t key during bootup'
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 10/18
0rom the boot menu- select recovery mode- which is usually the second boot option'
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 11/18
A&ter you select recovery mode and wait &or all the boot1up processes to &inish- you)ll be presented with a &ew options' (n this case- you want the Drop to root shell promptoption so press the Down arrow to get to that option- and then press nter to select it'
#he root account is the ultimate administrator and can do anything to the Ubuntuinstallation Eincluding erase itF- so please be care&ul with what commands you enter inthe root terminal'
nce you)re at the root shell prompt- i& you have &orgotten your username as well- type
s /home
#hat)s a lowercase 3- by the way- not a capital i- in ls' ou should then see a list o& theusers on your Ubuntu installation' (n this case- ()m going to reset Susan Brownmiller)s
password'
#o reset the password- type
passwd username
where username is the username you want to reset' (n this case- ( want to reset Susan)s
password- so ( type
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 12/18
passwd susan
ou)ll then be prompted &or a new password' 5hen you type the password you will getno visual response acknowledging your typing' our password is still being accepted'=ust type the password and hit nter when you)re done' ou)ll be prompted to retype
the password' Do so and hit nter again'
Gow the password should be reset'
#ype e$it
to return to the recovery menu'
A&ter you get back to the recovery menu- select resume normal boot- and use Ubuntuas you normally wouldonly this time- you actually know the password!
source
shareimprove this answer
answered Apr * )*8 at 8:2*
Iingtail7-997<89*8<
upvote 9downvote
ou can change your password i& you have access to the &ile /et"/shadow Emaybe with
your root account- via sudo &rom anotother account- &rom recovery mode- or with a3iveCD>DDF'
#his shadow password &ile has all the users and encrypted passwords Eas well as otheradministrative in&ormationF &or the system' #he &ields are separated by : ' 0or eample :
54UBUSEN;3E:)C),u*i.o)D0n;8Fj'eGm3H6d'd*IJu17*ds%0UdH7X89gK%wwmD6<dIEI5FED$E"5;,o3bo5ho<rp!JLm1tD':*GG96:6:88888::::
#he password is the second group o& characters a&ter 54UBUSEN;3E- between the twocolons' ou can replace this with a other password- &or eample- you could replace theeisting password string Etruncated &or clarityF:
)C),u*i.o)D0n;8Fj'eGm3H6=>bo5ho<rp!JLm1tD'
with
)C)Fg3d%.n)5"hCrG!sJh8j4g6U%e9Fu1o0LS53ShJbGp1;,rE/;6o!E'+ef4gpbboeoe6L8KJN1uC5F52uD1/
#he encrypted string represents PhackmeP' #his would be your new password'
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 13/18
shareimprove this answer
edited Gov 9 )*8 at 88:9+
belac%ua<-8*99
answered =ul *. )*8 at *7:2<
AndrTs Iicardo #orres Martne@928*;
up
vote8downvote
Go- there is Pno wayP to retrieve the old password'
es- you can change the password without knowing the old one' #he process isdescribed on several sites on the net- easily &ound via a search Ehttp:>>www'google'com>search6clientVubuntuLchannelV&sL%VchangeW&rogottenWpasswordWubuntuLieVut&1.LoeVut&1. F
(& you do that however and happened to have used an encrypted >home1directory &or thatusername you are likely not to gain access to the &iles in your >home1directory Eand i&you do then Ubuntu should be uninstalled'''F
shareimprove this answer
answered Mar 9* )*8 at 8*:;*
user287+;
87*
upvote8downvote
(n which S have you &orgot the password- Ubuntu or K/6 0or Ubuntu- in the bootJIUB menu- you may append initA/bin/bash to the kernel boot parameter to get a
root shell'
shareimprove this answer
answered May *8 )*8 at 8:;;
KiX =YlTi*-2272**8
(t is the password o& Ubuntu my &riend 'And ( got it done 'Any way a big thanks toyou too &or your kindness Kie' ? Goah Dia@ May *8 )*8 at 9:8*
n the askubuntu site you ask &or 5indows Kp6 :D ? sai.7 Sep *7 )*8 at ;:**
up vote* downvote
#hese answers seem to re1open the debate on Security versus Convenience'
3ibre &&ice advises that i& you &orget a password to a &ile- it cannot be retrieved-
and ( believe MZ cel and 5ord operate similarly'
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 14/18
(& ( boot my computer in 5indows PSa&eP mode Ee%uivalent o& PIecoveryPF- ( donot need a password or even administrative privileges to log in as Super1administrator- which parallels the 3inu situation described above' However- ( could
put one in- which in the event o& my computer being lost or stolen would mean that
5indows is more secure than 3inu'
( am not suggesting that 3inu should- or even could change this as the system iscertainly more secure against the much greater threat o& hacking- but does it notmean we must always be aware that we are not as private as we would like to be6
shareimprove this answer
answered Gov *7 )*8 at .:8+
5JCman.<<
5e can put a password to the 3inu Ubuntu root too! ncrypted &ilesystem is theonly security- whether 3inu or 5indows' /rivacy isn)t an issue here' /rivacycomes into play when you are online' ? Sri May *2 at 2:*.
up vote* downvote
0rom the o&&icial Ubuntu 3ost/assword documentation:
*' Ieboot your computer
8' Hold shi%t during boot to start JIUB menu
9' Highlight your image and press )e) to edit
;' 0ind the line starting with PlinuP and append rw initA/bin/bash at the
end o& that line
2' /ress ctrl1 to boot'
' #ype in passwd username
<' Set your password'
.' #ype in reboot' (& that doesn)t work- hit "trWatWde
#his works &or 3inu Mint *;- too'
&ey'oard"(ayout
"5I#
shareimprove this answer answered Mar ** at *:92
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 15/18
moose;;;*;*<
up vote1* downvote
Somehow booting into recovery mode did not work &or me because it would not boot into the root system' And when ( tried to change the root password it asked me&or the root password- which ( didn)t have' An alternative to this problem is usingUKterm which is a simpler version o& terminal and seems to have root systemcapabilities' =ust type in PpasswdP and enter your new password and it)s changed'
#his works &ine &or Ubuntu *'*+' to bring up command line' nter sudo passwd root'nter new password 8K' back to JU(' 3ogout- then login as root to test'
share improve this answer
edited =un *< )*8 at *.:*7
Community[*
answered Mar 87 )*8 at 89:82
\oo;
#his un&ortunately won)t work &or most cases' ? belac%ua Gov 9 )*8 at 88:98
protected 'y ommunity) Apr 1* +1, at *-./
#his %uestion is protected to prevent Pthanks!P- Pme too!P- or spam answers by new users' #oanswer it- you must have earned at least *+ reputation on this site'
tagged
password $ 98
asked , years ago
viewed 1.*.03 times
active today
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 16/18
*2 votes ] comment ] stats
Jet the weely newsletter!
• #op %uestions and answers
• (mportant announcements
• Unanswered %uestions
see an eample newsletter
(ined
8;How to G# become a root user6 Are administrators root6
*+How do ( reset a lost password Eusing recovery mode re%uires me to type the passwordF6
.( deleted the ^>etc>passwd_ &ile and cannot log in
9How do ( login as root6
85hat is the de&ault password &or Ubuntu *8'+;6
8Authenticate user that has no password6
+
( seem to have &orgoten my password
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 17/18
*How do ( reset password in Ubuntu **'*+
*Change user password while password is empty
+How can ( delete an administrator account &rom the guest login6 see more linked %uestionsO
elated
2How to reset lost user password on a guest on M5are server6
9How to change the User password
*+How do ( reset a lost password Eusing recovery mode re%uires me to type the passwordF6
1*(s there a way to reset 5indows K/ administrator password6
+( lost my password guys
*( disabled login options- how do ( reset my password6
*How to remove encryption password
+How to reset my password6
19Server 8++9 password reset H3/!
+How to change administrator password6 %uestion &eedabout help badges blog chat data legal privacy policy obs advertising in&o mobile contact us %eed'ac
Technology (i%e 2 Artsulture 2
ecreationcience #ther
*' Stack ver&
*' /rogr amme
*' Database
*' /hotograph
*' nglish
*' Mathemati
*' Stac
7/25/2019 Ubuntu Debug
http://slidepdf.com/reader/full/ubuntu-debug 18/18
low
8' Server0ault
9' Super User
;' 5ebApplications
2' AskUbuntu
' 5ebmasters
<' JameDevelopment
.' #eK 13a#eK
rs
8' UniL
3inu
9' AskDi&&er entEAppleF
;' 5ord/ressAnswers
2' Jeogr aphic(n&or mationSystems
' lectr icalngineering
<' Androidnthusiasts
.' (#
Security
Administrators
8' DrupalAnsw
ers
9' Share/oint
;' Userper ience
2' Math
ematica
' moreE*;F
y
8' Science0iction L0anta
sy
9' SeasonedAdviceEcook ingF
;' Home(mpro
vement
2' moreE*9F
3anguageLUsag
e
8' Skeptics
9' MiodeyaE=udaismF
;' #ravel
2' Christianity
' Ar%adeEgam
ingF
<' Bicycles
.' Iole1 playingJames
7' moreE8*F
cs
8' Crossalidated
EstatsF
9' #heor eticalComputerScience
;' /hysics
2' moreE<F
kA
p
ps
8' MetaStackver
&low
9' Area2*
;' St
ackver &lowCar eers
site design > logo ` 8+*9 stack echange inc4 user contributions licensed under cc1wiki withattribution re%uired rev 8+*9''.'<9*Ubuntu and Canonical are registered trademarks o& Canonical 3td'