In RedHat , I want to login with other user firstly in SSH, such as the user input when installing OS , then su - root , instead of being able to login with root directly in SSH
How to set in command line and config files ? I have no UI .
If you want to stop remote login through ssh by root. You just edit configuration file of ssh server.
# vim /etc/ssh/sshd_config #PermitRootLogin yes
remove # and replace yes to no
after that restart sshd deamon.if you are in centos6/5/RHEL6/5/ubuntu
# /etc/init.d/sshd restart
or If your are in centos7/RHEL7/Ubuntu
# systemctl restart sshd.service