> Sent: Monday, November 11, 2024 at 9:02 PM
> From: "Alain D D Williams" <a...@phcomp.co.uk>
> To: debian-user@lists.debian.org
> Subject: sudo makes me appear to be logged in again
>
> I am running Debian 12.7
>
> I logged in via ssh at 16.14 and then went: sudo -s
>
> If I run "w" I now appear to be logged in twice (1.52 is the current time):
>
> addw     pts/0    2001:4d48:ad51:2 16:14   40.00s  0.02s  0.01s sudo -s
> addw     pts/1    2001:4d48:ad51:2 01:52    3.00s  0.00s  0.01s sudo -s
>
> So I am now on a different tty and the old one shows idle time.
>
> I get similar results if I run "who".
>
> ps shows interesting results:
>
> # ps -f
> UID          PID    PPID  C STIME TTY          TIME CMD
> root       28669   28644  0 01:52 pts/1    00:00:00 sudo -s
> root       28670   28669  0 01:52 pts/1    00:00:00 /bin/bash
> root       28979   28670  0 01:59 pts/1    00:00:00 ps -f
> # ps -fp28644
> UID          PID    PPID  C STIME TTY          TIME CMD
> root       28644    1819  0 01:51 pts/0    00:00:00 sudo -s
>
> What is happening ?
>
> --
> Alain Williams
> Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
> Lecturer.
> +44 (0) 787 668 0256  https://www.phcomp.co.uk/
> Parliament Hill Computers. Registration Information: 
> https://www.phcomp.co.uk/Contact.html
> #include <std_disclaimer.h>
>
>

man sudo..........

     -s, --shell
             Run the shell specified by the SHELL environment variable if it is 
set or the shell specified by
             the invoking user's password database entry.  If a command is 
specified, it is passed to the
             shell as a simple command using the -c option.  The command and 
any args are concatenated, sepa-
             rated by spaces, after escaping each character (including white 
space) with a backslash ('\') ex-
             cept for alphanumerics, underscores, hyphens, and dollar signs.  
If no command is specified, an
             interactive shell is executed.  Most shells behave differently 
when a command is specified as
             compared to an interactive session; consult the shell's manual for 
details.

Reply via email to