Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2912

サーバ内の不要ユーザ追い出し

$
0
0
きっかけ EC2で通信が遮断された際にSSHのプロセスが残っているのが気になりやってみました。 ですので、ただの備忘録です TODO クライアント % ssh hoge-server サーバ $ w 12:00:00 up 1 days, 1:23, 1 user, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT fuga pts/0 xxxxxxxxxx.a 12:30 4.00s 0.05s 0.00s sshd: fuga [priv] hoge pts/1 xxxxxxxxxx.a 12:50 4.00s 0.05s 0.00s w $ ps ax | grep sshd 3336 ? Ss 0:00 /usr/sbin/sshd -D 22221 ? Ss 0:00 sshd: fuga [priv] 22223 ? S 0:00 sshd: fuga@pts/0 22228 ? Ss 0:00 sshd: hoge [priv] 22229 ? S 0:00 sshd: hoge@pts/1 $ kill -9 22223 解説 w ログインユーザの確認 whoでも確認可能 ps ax | grep sshd sshdのプロセスIDを確認 kill -9 プロセス強制終了コマンド 参考 https://eng-entrance.com/linux-command-kill https://www.atmarkit.co.jp/ait/articles/1807/26/news009.html https://uxmilk.jp/50638

Viewing all articles
Browse latest Browse all 2912

Trending Articles