If you use sudo to perform operations on files that already exist, then the permissions and ownership on those files after the operation will be the same as the permissions and ownership were before the operation (assuming that the operation is not intended to change ownership or permissions, e.g. chmod or chown). If a file is created as a result of the sudo operation, then the new file will be owned by the user who you become for sudo purposes.
If what you want is an interactive shell session, then the safest thing to do is use 'sudo -i' to get a root prompt, since this makes it less likely that you will unintentionally modify files in your own home directory or create files in your user home directory that you will not be able to access later due to permissions. It's also a good idea to close the shell with the root prompt as soon as you are done with the operation that you opened it for. Leaving it open makes it more likely that you will forget it's a root prompt and do something as root that you didn't intend to do.
The most common use of 'sudo -s' is when you want to run a complicated shell command line as root and need variables from your environment or your own customized config files in order to make it work. A contrived example would be:
Code:
sudo -s 'find $HOME/Images > /tmp/$SUDO_USER-home-Images.out'
I need the value of $HOME from my user environment but I want the resulting file to be owned by root. I need the -s switch so that the command line will be correctly interpretted, since it contains special shell simbols like '>' for redirection.
It's a good idea to use 'sudo -s' only for one-line shell expressions and only when you are absolutely certain that you need to preserve your user environment.