sudo su
is not the same as logging in as root.
sudo su -
(or
sudo su -l
) is the way (or another way) to simulate a login shell.
Please review the manual entry
su(1) before proceeding further. It will help to explain why your $HOME environment variable is wrong, and why other environment variables are wrong.
Also, you should execute the command
PS1="\u@\h:\w \\$ "
from the command line, right away-- this will allow you to see what your present working directory is.
Edited to add: Following SirDice's advice, you should probably review the manual entry for
sudo(8) instead of
su(1)-- I don't use sudo so I don't understand it so well.
Once you can see what your present working directory is, you should try to sort out which .profile and .shrc files you've been editing. You should restore
/home/ihor/.profile and
/home/ihor/.shrc to their original contents, and put your changes in
/root/.profile and
/root/.shrc instead.
Any time you're uncertain about what your present working directory is, you can just run
pwd
to see. If you have any questions about this, please ask.
Also, please read
pwd_mkdb(8) to learn how to fix your
/etc/passwd file. You should never manually edit your passwd file. I also recommend reading the following two threads:
Thread having-trouble-changing-shell-with-chsh.78914
Thread unable-to-change-shell.24720