By default, when you install ESX 4.0, the root access is disable. To enable it, you can follow bellow step.
1. Press ALT+F1 to access the console and login as root
2. vi /etc/ssh/sshd_config
3. Look for PermitRootLogin and change it to yes
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
4. Restart the sshd service
# service sshd restart
If you want to ssh to another server in esx, by default it being block. You will get port 22: connection refused error so, execute below command as root to open firewall ports.
# esxcfg-firewall -e sshServer
# esxcfg-firewall -e sshClient
Good Luck!