What's new
  • Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as: All that and more! Registration is quick, simple and absolutely free. Join our community today!

OpenSSH Management - Reset Server (SSH Accounts)

Xin Snowflakes

Eternal Poster
Established
Joined
Jan 28, 2019
Messages
1,127
Reaction score
720
Age
22
, Last edited:
Delete's all OpenSSH Accounts at once.. ;) ☕ :eek:

Debian:

Code:
while IFS=":" read -r users x uid x;
do [[ $uid -gt 1000 ]] && userdel -r -f "$users";
done < /etc/passwd

CentOS:

Code:
while IFS=":" read -r users x uid x;
do [[ $uid -gt 500 ]] && userdel -r -f "$users";
done </etc/passwd

Note:
Delete's all SSH Users Debian and CentOS all at once or simply reset every OpenSSH Account.. :)

( CTTO: Bon-Chan )

( C ) - Compiled by Snowflakes.
 

Trending Topics

Trending On This Forum

Unanswered Topics

Top