≡ Menu

logins

How do I see if my friends or coworkers are logged into the same Linux or BSD or UNIX (AIX, HP-UX, Apple OS X) server / workstation as I am from a command line?
[click to continue…]

How do I deny access to user account? Do I need to use /bin/false or /sbin/nologin to refuse a login?
[click to continue…]

Linux Display Date And Time Of Login

How do I display user last login date and time under Linux operating systems?
[click to continue…]

Q. I've Debian Linux server and whenever someone trying to ssh into this box, they get an error as follows and server closes the connection:

System bootup in progress -please wait

How do I fix this problem and allow ssh login?
[click to continue…]

Reboot Linux System Command

How do I reboot my Linux based system? How do I reboot a remote Linux system or server using command line?
[click to continue…]

Q. How do I block access to root user over ssh session?

A.. sshd (OpenSSH Daemon) is the daemon program for ssh. Server side ssh configuration is defined in /etc/ssh/sshd_config file.

You need to use DenyUsers option to block access to root user.

This option can be followed by a list of user name patterns, separated by spaces. Login is disallowed for user names that match one of the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USER@HOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts.

Open /etc/ssh/sshd_config file

Use vi command:
# vi /etc/ssh/sshd_config

Deny root user access

Append or modify as follows to block root user:
DenyUsers root

If you want to block additional user just append names to DenyUsers
DenyUsers root, user2, user3

Save and close the file. Restart sshd service:
#/etc/init.d/sshd restart