Question regarding sudo command

Hi,

I get error when

sudo -u user1 -s -H
(AD: coro.int) Password:
cannot access parent directories

I do not get error when

sudo -u user1 -i -H

Can you tell me why do i not get error when using -i option instead of -s option with sudo .

$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v
  -i [command]  run a login shell as target user
  -s [command]  run a shell as target user

Basically, can u make it easy for me(layman) to understand the above -i and -s options as to how they are different ?

Please reply in context of the error i am getting and why the pwd command does not yield output with the -s option when it does with the -i option.

-i runs a login shell so your current working directory will be set to the home directory of user1. Without this your CWD is not changing and user1 does not have read/execute access on the current directory where sudo is executing from.

Try this and post the output.

ls -ld .  #check permissions.
cd /tmp
sudo -u user1 -s -H

Write a script named time that displays the time in standard 12-hour format, rather than 24-hour format. Allow the user to give a -m option to get 24-hour format. For example:
> date
Sun Feb 10 10:56:50 CST 2008

> time
10:56 AM

> date
Sun Feb 10 21:57:07 CST 2008

> time
9:57 PM

> time -m
21:57