sudo -i
-i, --login
Run the shell specified by the target user's password
database entry as a login shell. This means that login-specific resource
files
such as .profile, .bash_profile or .login will be read by
the shell. If a command is specified, it is passed to the shell for
execu‐
tion via the shell's -c option. If no command is
specified, an interactive shell is executed. sudo attempts to change to
that user's
home directory before running the shell. The command is
run with an environment similar to the one a user would receive at log in.
Note that most shells behave differently when a command
is specified as compared to an interactive session; consult the shell's
manual
for details. The Command environment section in the
sudoers(5) manual documents how the -i option affects the environment in
which a
command is run when the sudoers policy is in use.
Also, If you need to edit a file as root, use sudo -e /path/to/file
instead of sudo nano/vim/emacs/ed /path/to/file
-e, --edit Edit one or more files instead of running a command. In
lieu of a path name, the string "sudoedit" is used when consulting the
secu‐
rity policy. If the user is authorized by the policy,
the following steps are taken:
1. Temporary copies are made of the files to be edited
with the owner set to the invoking user.
2. The editor specified by the policy is run to edit
the temporary files. The sudoers policy uses the SUDO_EDITOR, VISUAL and
EDITOR
environment variables (in that order). If none of
SUDO_EDITOR, VISUAL or EDITOR are set, the first program listed in the
editor
sudoers(5) option is used.
3. If they have been modified, the temporary files are
copied back to their original location and the temporary versions are
removed.
To help prevent the editing of unauthorized files, the
following restrictions are enforced unless explicitly allowed by the
security
policy:
· Symbolic links may not be edited (version 1.8.15 and
higher).
· Symbolic links along the path to be edited are not
followed when the parent directory is writable by the invoking user unless
that
user is root (version 1.8.16 and higher).
· Files located in a directory that is writable by the
invoking user may not be edited unless that user is root (version 1.8.16
and
higher).
Users are never allowed to edit device special files.
If the specified file does not exist, it will be
created. Note that unlike most commands run by sudo, the editor is run
with the
invoking user's environment unmodified. If, for some
reason, sudo is unable to update a file with its edited version, the user
will
receive a warning and the edited copy will remain in a
temporary file
----- Original message -----
From: "James H. H. Lampert" <jamesl@xxxxxxxxxxxxxxxxx>
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Cc:
Subject: Re: Here there be Dragons!
Date: Mon, Feb 4, 2019 10:48 AM
On 2/3/19, 10:38 AM, Jack Woehr wrote:
> of course you can
>
> $ sudo su -
> [sudo] password for jwoehr:
> #
Or "sudo bash"
--
JHHL
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [1]
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [2]
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: [3]
https://amazon.midrange.com
References
Visible links
1.
https://lists.midrange.com/mailman/listinfo/midrange-l
2.
https://archive.midrange.com/midrange-l
3.
https://amazon.midrange.com/
As an Amazon Associate we earn from qualifying purchases.