Logout a SSH user.

General support questions
Post Reply
hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Logout a SSH user.

Post by hack3rcon » 2019/11/04 12:43:27

Hello,
I used "w" command to see which user is logging on server. After it I did:

Code: Select all

# pkill -KILL -u "Username"

After it, I can't SSH to my server :(
Some part of SSH config:

Code: Select all

StrictModes yes
MaxAuthTries 3
MaxSessions 1
ClientAliveInterval 300
ClientAliveCountMax 5
How can I solve it?

Thanks.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Logout a SSH user.

Post by Whoever » 2019/11/04 21:40:54

What user did you kill?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logout a SSH user.

Post by TrevorH » 2019/11/04 22:24:30

I bet it rhymes with shoot...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Logout a SSH user.

Post by lightman47 » 2019/11/04 23:43:20

I bought & read a number of books on Linux - and still am sadly way behind. You have to know what the command you are going to issue is going to do BEFORE you issue it - and how to recover if it does something other than what you expect (happens a LOT). ;)

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: Logout a SSH user.

Post by hack3rcon » 2019/11/05 08:12:52

Whoever wrote:
2019/11/04 21:40:54
What user did you kill?
I saw two users with the same name and I killed one of them.

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: Logout a SSH user.

Post by tunk » 2019/11/05 11:21:35

How did you see those two users?
It may e.g. be that the user have opened two putty instances from the same (windows) PC.

billwest
Posts: 154
Joined: 2006/11/19 10:50:31
Location: Perth, Western Australia

Re: Logout a SSH user.

Post by billwest » 2019/11/05 12:41:11

When I see users with the same name (could be me), I prefer to go about logging one off in a longwinded way.

Commands I use:

who
who am i
ps -A | grep bash

All of this should get you the users' bash PIDs.

Then kill -9 'relevant PID'.

Works for me.

Post Reply