Friday, November 30, 2007

Allow root remote ssh connection to a Solaris 10 environment using PuTTY

In order to allow a remote PuTTY ssh connection in a Solaris 10 OS, the sshd_config file have to be edited in the server that you want to connect with.

1) Modify the permit access asociate with root

# vi /etc/ssh/sshd_config
PermitRootLogin yes

2) Restart the ssh service in the server, with the "svcadm" command

# svcadm restart /network/ssh

3) Make sure the ssh service is restarted, following the example:

# svcs -agrep ssh
online Nov26 svc:/network/ssh:default

4) The remote connection may be established with success

Root Password Recovery - Solaris OS

1) You need to have physical access to the machine's console.

2) Boot the system in single-user mode

Note: In order to make the system boot you should Press the STOP and A keys simultaneously in your keyboard, you can also use an ASCII terminal, send a to halt the operating system, if still running.

* Boot the systems from CD-ROM:
#boot cdrom -s
* Boot the system from the network (if you have a jumpstart server configured, also make
sure the BIOS in your server is configured to allow the server to boot from the network)
#boot net -s

3) Mount the root partition on "/a"
"/a" -> empty mount point that existsat this stage of the installation procedure.
#mount/dev/dsk/c0t0d0s0 /a

If you don't remember the root partition I recommend you to
#ls /tmp/dev/dsk -> verify the partitions availables and test until you find the correct one.

4) Set your terminal type so you can use with out a problem "vi" command in order to edit the /etc/shadow file

/etc/shadow -> in this file the root password is encrypted and you want to eliminate that entry.

#TERM=sun; export TERM
If you are using anascii terminal or terminal emulator on a PC
#TERM=vt100; export TERM

5) Edit and remove the encrypted password entry for root
#vi /a/etc/shadow ->if you have a solaris older version try /etc/passwd, the password should have no entry(::)

6) Umount the "/a" to make the change permanent
#cd;umount /a


7) Reboot in single-user mode
boot -s

8) The root user will not have a password assigned, fell free to give a new one using the "passwd" command.