D
D
Dmitry2015-11-02 09:14:04
linux
Dmitry, 2015-11-02 09:14:04

What is the difference between "sudo -i" and "sudo su -" commands?

Is there any difference between sudo -i and sudo su - ?

Answer the question

In order to leave comments, you need to log in

9 answer(s)
R
Ruslan Fedoseev, 2015-11-02
@Thelema

sudo su - fully login as root.
sudo -i login is emulated.
Outwardly, the difference looks something like this:

[[email protected] ~]$ sudo -i
[[email protected] ~]# id
uid=0(root) gid=0(root) группы=0(root)
[[email protected] ~]# export
declare -x DISPLAY="localhost:10.0"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="martin.office.lds.ua"
declare -x KDEDIRS="/usr"
declare -x LANG="ru_UA.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd                                                                       =40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=3                                                                       0;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:                                                                       *.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=0                                                                       1;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;                                                                       31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01                                                                       ;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ea                                                                       r=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31                                                                       :*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01                                                                       ;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.ti                                                                       f=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;3                                                                       5:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.og                                                                       m=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:                                                                       *.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01                                                                       ;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=                                                                       01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.                                                                       au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;                                                                       36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf                                                                       =01;36:"
declare -x MAIL="/var/spool/mail/root"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
declare -x PWD="/root"
declare -x QTDIR="/usr/lib64/qt-3.3"
declare -x QT_GRAPHICSSYSTEM_CHECKED="1"
declare -x QT_PLUGIN_PATH="/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass"
declare -x SUDO_COMMAND="/bin/bash"
declare -x SUDO_GID="1000"
declare -x SUDO_UID="1000"
declare -x SUDO_USER="martin"
declare -x TERM="linux"
declare -x USER="root"
declare -x USERNAME="root"
[[email protected] ~]# logout
[[email protected] ~]$ sudo su -
Последний вход в систему:Срд Окт 28 18:58:48 MSK 2015на pts/1
Последняя неудачная попытка входа в систему:Пнд Ноя  2 08:51:38 MSK 2015с 211.99                                                                       .249.89на ssh:notty
Число неудачных попыток со времени последнего входа: 30.
[[email protected] ~]# export
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="martin.office.lds.ua"
declare -x KDEDIRS="/usr"
declare -x LANG="ru_UA.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd                                                                       =40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=3                                                                       0;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:                                                                       *.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=0                                                                       1;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;                                                                       31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01                                                                       ;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ea                                                                       r=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31                                                                       :*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01                                                                       ;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.ti                                                                       f=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;3                                                                       5:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.og                                                                       m=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:                                                                       *.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01                                                                       ;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=                                                                       01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.                                                                       au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;                                                                       36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf                                                                       =01;36:"
declare -x MAIL="/var/spool/mail/root"
declare -x OLDPWD
declare -x PATH="/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin                                                                       :/usr/sbin:/usr/bin:/root/bin"
declare -x PWD="/root"
declare -x QTDIR="/usr/lib64/qt-3.3"
declare -x QTINC="/usr/lib64/qt-3.3/include"
declare -x QTLIB="/usr/lib64/qt-3.3/lib"
declare -x QT_GRAPHICSSYSTEM_CHECKED="1"
declare -x QT_PLUGIN_PATH="/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass"
declare -x TERM="linux"
declare -x USER="root"
declare -x XDG_SESSION_ID="13889"
[[email protected] ~]# id
uid=0(root) gid=0(root) группы=0(root)
[[email protected] ~]#

as you can see - with sudo su - all the root initialization files were executed, the system displayed information about previous logins, with sudo -i - no
, and the environments do not match ...

M
mcavalon, 2013-08-05
@mcavalon

I think you should choose Java. You will not regret

P
pomeo, 2013-08-05
@pomeo

In general, is it really possible to freelance in java from scratch without first working in an office?

And who will take you to the office at the beginning?
Try everything, what difference does it make. Wherever you like it, go that way.

V
Vyacheslav Slinko, 2013-08-05
@KeepYourMind

Java is stable, JavaScript is a trend, and Python is in between.
From my belfry, it can be seen that there are far fewer smart front-end developers than smart Java or Python developers.

N
nifus, 2013-08-05
@nifus

Since the question is about freelancing, then javascript, php. work in this direction is the easiest to take.
the rest is interest or even fractions of a percent on the exchanges.
Starting from scratch in java or another language, orders in which flash on the exchanges once a day is unlikely

N
nifus, 2013-08-05
@nifus

Where is it better to start in our or foreign freelancing?

Over the hill they pay more, the chance that they will throw less, there is almost no anonymity. Get a bad review, then don't wash off.
We have a mess, a lot of shkoloty and threw. but at the same time, you pay less for a mistake because it is practically anonymous.

P
Puma Thailand, 2013-08-05
@opium

Start with java and don't worry. There is always a lot of work on it, it is in the enterprise and its support period will be very long, that is, you will start as a Java programmer and most likely die as a Java programmer.
Work for odesk.com where seasoned javistists cut 50 bucks an hour.
pumainthailand.com/diskussiya-o-freelanse-i-odeske-na-radio-anon-fm-s-pumoj/

C
Crash, 2013-11-27
@Bandicoot

Try different directions. Sooner or later you'll find your way

A
avegolove, 2015-01-05
@avegolove

Where is C# on which you can write freelance programs for customers?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question