Unix question

ConantheBarbarian

Senior member
Nov 8, 2000
239
0
0
Just bought a Sun Solaris 10 Server and I have no clue what to do with it. The OS is password protected but the seller told me I can rewrite the password by mounting the hard drive by using the installation CD. Can anyone help me with this problem I do have the installation CD and all. Any one know any good books to read on unix system works and administration also security or even websites I can go to.

Thanks.
 

wyvrn

Lifer
Feb 15, 2000
10,074
0
0
The act of mounting the hard drive doesn't have anything to do with the password. Mounting just applies a file system to your directory structure, for instance you could mount the directory /newdir to a specific slice on a hard disk or a specific hard disk in an array. To recover the password, you have to reinstall Solaris. I have done this before but I will have to look for the specifics and get back to you. Its in my notes somehwere.

I don't know of any other way to recover the root password on a Unix box, like on a Windows box you can reset the admin password by screwing with the .sam file. Unix boxes are typically more secure than this.


edit: Try this first:

1- Boot up the computer, you should be able to get to the login prompt.
2- Put the Solaris cd into the cdrom drive.
3- Depress the keys STOP and A. This will bring your OS to a baseline state.
4- At the OK prompt, type "boot cdrom" (without the quotation marks).

This should boot to cdrom and give you option to reinstall. I would suggest using the partition manager to reset the partitions (slices in Unix terminology). If you want to know a sample slice setup, PM me and I will give you specifics. Any questions, PM or email me. Let me know if this works.


Books:

For basic Unix commands I recommend reading Unix Primer Plus, 3rd ed. by Martin, Prata, et. all. You can find this on half.com most likely. For Solaris specific help, I recommend buying the certification books which are probably available sun.com. They are very good and get to the point of what you will need to know to administer the server.
 

rawko

Golden Member
Jan 17, 2000
1,259
0
0
You can mount the drive and change the /etc/passwd file. Make a new user. Do a 'passwd 'user''. Then take the hash for the pw in /etc/passwd for user and copy it over the root one. Then boot off of the hd and you can login as root /w the new pw.
 

wyvrn

Lifer
Feb 15, 2000
10,074
0
0
Originally posted by: rawko
You can mount the drive and change the /etc/passwd file. Make a new user. Do a 'passwd 'user''. Then take the hash for the pw in /etc/passwd for user and copy it over the root one. Then boot off of the hd and you can login as root /w the new pw.

If he doesn't have root priveledges, he won't be able to edit the /etc/passwd file will he?

 

rawko

Golden Member
Jan 17, 2000
1,259
0
0
If you boot off the install cds or else, get to a console, and mount the drive, you can write to the file. It's not like ntfs where you can have file permissions that will stay if you put the drive in another machine.
 

wyvrn

Lifer
Feb 15, 2000
10,074
0
0
Ok. But how do you get to a console from the boot cd? I haven't done it before.
 

Beattie

Golden Member
Sep 6, 2001
1,774
0
0
Originally posted by: wyvrn
Originally posted by: rawko
You can mount the drive and change the /etc/passwd file. Make a new user. Do a 'passwd 'user''. Then take the hash for the pw in /etc/passwd for user and copy it over the root one. Then boot off of the hd and you can login as root /w the new pw.

If he doesn't have root priveledges, he won't be able to edit the /etc/passwd file will he?

It you booted off the CD, then you will have root priv. Mounting the other drive just gives you access to the filesystem that's there. If you mounted it at / or /etc then you will have root access to /etc/passwd

 

wyvrn

Lifer
Feb 15, 2000
10,074
0
0
Well guess what, we went over how to do this today in class. The specific steps, that worked on my Sun server:

Put your OS cd into the drive.

1- Press the STOP and A keys simultaneously. You will get an OK prompt.
2- Type "boot cdrom -s" (without quotes) This will cause your system to boot off of the Sun cd and get another OK prompt.
3- After reboot, type "fsck /dev/rdsk/c0t0d0s0" (without quotes again) to check your file system integrity and repair (STOP - A can damage it). The 0 are zeros, not the letter O.
4- type "mkdir /tmp/disk"
5- type "mount /dev/dsk/c0t0d0s0 /tmp/disk" (zeros again, and this command will mount your hard disk to the directory /tmp/disk for manipulation)
6- type "vi /tmp/disk/etc/shadow" (this will open shadow file in vi, a text editor)
7- You will see a colon separated file of users and their passwords. You want the one that starts with root. After the first colon, erase all characters until the second colon. The result should be "root::-otherstuffhere-" . The nothingness beween the first two colons means you have a blank password for the root account. To exit VI, hit the escape key twice. Then type :wq! which will save changes and leave vi.
8- type "reboot"

You will now be able to login with the root account and a blank password. Then you can use the passwd command to set yourself a new password.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |