When i open the terminal and type
su XXXXX
where terminal open in the name of XXXXX
, it ask for password and switched. Am i not already there in the first place when i opened the terminal? So What is the differences between terminal open in the first place and terminal open after I switch to same as open in first? I do not seems to find any differences here.
When i type exit
it exits and bring me where i am before. Am i always in same place or different? If i am on same place why switching account happen ?
su , sudo-s
, i am surely going different way. – parlad Feb 10 '18 at 16:09exit
always returns you back to the same user that you logged in with. If this user is not root then you need to usesudo
to run commands with root privileges. – karel Feb 10 '18 at 16:17exit
does that ,but who am i before switching and after switching myself ? Is there privilege differences , Although why it is switching to myself? – parlad Feb 10 '18 at 16:20sudo
andsu
you must understand that each one of these variations was created for a different purpose and misusing them can make a disaster. The safest alternative (not always the most time-saving one) is to preface a command bysudo
every time you want to run that command with root privileges. – karel Feb 10 '18 at 16:24