Try Match
in sshd_config
:
Match User user1,user2,user3,user4
PasswordAuthentication no
Or by group:
Match Group users
PasswordAuthentication no
Or, as mentioned in the comment, by negation:
Match User !root
PasswordAuthentication no
Note that match is effective “until either another Match line or the end of the file.” (the indentation isn’t significant)
Related Posts:
- mysql_config not found when installing mysqldb python interface
- ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
- Pseudo-terminal will not be allocated because stdin is not a terminal
- X11 forwarding request failed on channel 0
- mysql_config not found when installing mysqldb python interface
- Pseudo-terminal will not be allocated because stdin is not a terminal
- How to download a file from server using SSH?
- connect to host localhost port 22: Connection refused
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- How to configure WP filesystem access in Linux (Ubuntu Server)?
- Can I automatically add a new host to known_hosts?
- Can I nohup/screen an already-started process?
- Permission denied (publickey). SSH from local Ubuntu to Amazon EC2 server
- Is it normal to get hundreds of break-in attempts per day?
- How to setup passwordless `sudo` on Linux?
- How to reconnect to a disconnected ssh session
- Keeping a linux process running after I logout
- Is my password compromised because I forgot to hit Enter after ssh username?
- How to check if an RSA public / private key pair match
- how do you create an ssh key for another user?
- How to run command as user who has /usr/sbin/nologin as Shell?
- “POSSIBLE BREAK-IN ATTEMPT!” in /var/log/secure — what does this mean?
- Does getting disconnected from an SSH session kill your programs?
- Can you have more than one ~/.ssh/config file?
- How to prevent a user from login in, but allow “su – user” in Linux?
- How do I extract login history?
- SSH from A through B to C, using private key on B [closed]
- Show all users and their groups/vice versa
- SSHFS mount that survives disconnect
- Temporarily ignore my `~/.ssh/known_hosts` file?
- How can I fully log all bash scripts actions?
- What’s wrong with always being root?
- Hundreds of failed ssh logins
- protocol version mismatch — is your shell clean?
- What is the difference between /sbin/nologin and /bin/false?
- How do I grep recursively?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- -bash: syntax error near unexpected token `newline’ for display command
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- Changing the resolution of a VNC session in linux
- Using putty to scp from windows to Linux
- How does “cat << EOF" work in bash?
- What is difference between arm64 and armhf?
- How to count lines in a document?
- What does `set -x` do?
- How to get the process ID to kill a nohup process?
- Writing a simple shell in C using fork/execvp
- Implementation of multiple pipes in C
- Using ls to list directories and their total sizes
- tar: add all files and directories in current directory INCLUDING .svn and so on
- What does set -e mean in a bash script?
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- Pipe to/from the clipboard in a Bash script
- what does -zxvf mean in tar -zxvf filename?
- Retrieve last 100 lines logs
- Linux Bash: Move multiple different files into same directory
- Configuring Apache for localhost
- Android – Command not found
- What does ‘bash -c’ do?
- How do I know the script file name in a Bash script?
- Password change when the user login first time
- How to customise wp-login.php only for users who are setting a password for the first time?
- WordPress can’t find temporary folder, but folder it’s looking at has correct permissions
- How to redirect to a passworded page based on password entered on login screen
- How to create a word press user with hashedpassword
- Reset Password policy
- Custom Log In Screen – Disable password recovery [duplicate]
- How to password-protect everything except the logo
- wordpress/woocommerce login url not redirecting correctly
- I need to find which is the file that checks the DB for correct login (username, password)
- Login/password protected “client page”
- WordPress password reset not working
- Redirecting the lost password page request when using a custon login page
- New user password confirmation sending wrong URL
- How to password protect pages in WordPress
- Cannot login in WordPress even after changing hash password in phpmyadmin
- Trouble logging in and/or changing password
- How can I sort du -h output by size
- What exactly do the colors in htop status bars mean?
- How to run a server on port 80 as a normal user on Linux?
- Showing total progress in rsync: is it possible?
- How to bind MySQL server to more than one IP address?
- Moving an already-running process to Screen
- What’s the best way of handling permissions for Apache 2’s user www-data in /var/www?
- How to know from which yum repository a package has been installed?
- tar – Remove leading directory components on extraction
- How to list Apache enabled modules?
- How can I monitor hard disk load on Linux?
- What’s the reverse DNS command line utility?
- How to add a security group to a running EC2 Instance?
- How bad is it really to install Linux on one big partition?
- Is it possible to reboot a Linux OS without rebooting the hardware?
- How can I edit the welcome message when ssh start?
- Does the “bs” option in “dd” really improve the speed?
- What solutions exist to allow the use of revision control for server configuration files? [closed]
- Is there a way to do a remote “ls” much like “scp” does a remote copy?
- Dump a linux process’s memory to file
- Invalid login email notification for password-protected category