01-03-2017, 09:49 PM
(This post was last modified: 01-03-2017, 10:07 PM by MarkHaysHarris777.)
(01-03-2017, 06:49 PM)dkryder Wrote: is there any difference in final outcome between doing these commands,
sudo apt-get update
sudo apt-get upgrade
and doing these commands,
sudo su [enter password, become superuser]
apt-get update
apt-get upgrade
There is some debate about that actaully. The answer is yes and no; depending on what your goals are. Typically as an administator you want your users to run the former; the reason being that sudo has logging and accountability, is more secure, and allows the admin to 'govern' legitimately over the users who have uathority to use the sudo command. Also the environment can be controlled better.
sudo su - ( shouuld be avoided );
... the reason being that once the user is permanently logged in as the super user there is no more sudo logging and accountability. On the other hand, if there is only one user on the system ( as is the case for most RPi(s) or Pine(s) then who cares? ( there are nuances regarding environment here )
Now for the 'no' part of the answer. In terms of update and upgrade there is no real difference in 'outcomes' for either method. Some people prefer the following command, however;
sudo -i
... reason being that some people hate having to re-enter their password every so many minutes when the sudo command expires. sudo -i is preferred to sudo su - because the environment can be controlled better .
... reason being that sudo logging and accountability is still active.
See the man page for sudo for the nuanses between sudo su - and sudo -i. ( sudo -i ; sudo --login )
note: there is a nuance regarding whether the su experience has the system environment ( or user environment ) which includeds path and system variables , for instance. Again, see the man page for details.
( this is an opinion, and not all agree )
Notes:
Try these:
sudo su
pwd
exit
sudo su -
pwd
exit
sudo -i
pwd
exit
You will notice that ( sudo su ) is different in that it leaves the current directory alone ;
The other two will open the shell at /root
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )