Logout a SSH user.

General support questions
Post Reply
hack3rcon
Posts: 458
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: 1089
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
Forum Moderator
Posts: 27147
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...
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

lightman47
Posts: 999
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). ;)
Multple login IDs are not your friend when asking for help!

hack3rcon
Posts: 458
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: 622
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: 150
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

Return to “CentOS 6 - General Support”