Sample Header Ad - 728x90

How to show all current ssh connected users on Linux?

1 vote
1 answer
1936 views
Using GCP VM Instance, I'm connected via ssh, not serial port. When I type w or who or finger I get the following output:
$ w
08:46:18 up 41 min,  0 users,  load average: 0.10, 0.07, 0.01
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT

$ who                                                                                                                         

$ finger                                                                                                                      No one logged on.
I'm expecting to see my current connected user, but this is not the case. I tried to connect as another user along mine and it showed, but not my primary user, either when he or the other runs the command.
> pstree -alus "$$" 
systemd
  └─sshd
      └─sshd
          └─sshd,Dédé
              └─bash
                  └─bash
                      └─code-e170252f76 command-shell --cli-data-dir /home/Dédé/.vscode-server/cli --parent-process-id 234934 --on-port
                          └─sh /home/Dédé/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/bin/code-server --connection-token=remotessh --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-bd3d6d38-59de-47a1-8df7-54881cb666dd
                              └─node /home/Dédé/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/server-main.js --connection-token=remotessh --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-bd3d6d38-59de-47a1-8df7-54881cb666dd
                                  └─node /home/Dédé/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/bootstrap-fork --type=ptyHost --logsPath /home/Dédé/.vscode-server/data/logs/20240504T173238
                                      └─zsh -i
                                          └─pstree -alus 271031
Asked by Dédé (11 rep)
May 4, 2024, 10:57 AM
Last activity: May 6, 2024, 02:29 PM