Disable root login once taking problem second time

hello all

i am getting error in /etc/ssh/sshd_config i didnt find #PermitRootLogin written in file so i
wrote it by my self PermitRootLogin no and save file by :wq! then i recheck file so it was saved their then i restart sshd sudo service sshd restart and got mesege
redirecting to /bin/systemctl restart sshd.service after that i exit from stapp01 and then re login there and try to use ssh command to stapp02 so its working and my restriction on that server is not working can anyone tell what the problem
i did it before so it is working with the same way but my connection broke so i didnt complete my job after this these commands not working on it same way

1 Like

i just stated a new environment and try to use ssh to loging as root user :slight_smile:
ssh root@stapp01 but i permission denied message even thoug i didnt do any thing yet

1 Like

Hello,

Thank you for reporting this. If you face any issues with environment like unexpected behavior or something please report the same. Usually it happens due to weak internet connection or due to some connectivity issues. The quick workaround is to reload the entire session that will setup the new environment and you can start with that.

Thanks
Inderpreet

1 Like

sir i check it again but same problem kindly guide

hello
sir i shutdown my computer and start again went to task its created new environment then first of all i try to login through ssh root@stapp01 it took the password then messege permession denied i tried it on all servers gating the same answer its mean that root login through ssh is already working in environment i didnt do any thing else and wrote this mesage kindly reply what to do

1 Like

Hello,

Please look into project wiki page there you will be able to find out correct credentials that you can use to SSH into server.

Since you must be trying to SSH using root user with wrong password hence you are getting permission denied error but that doesn’t mean you have completed the task. Please let us know if you still have any issues.

Thanks
Inderpreet

1 Like

sir i am using the same correct credential through page https://kodekloudhub.github.io/kodekloud-engineer/docs/projects/nautilus i check them credentials are same on your page and mine let me explain when i got the task so started to do i login to ssh tony@stapp01 then i opened file
vi /etc/ssh/sshd_config then wrote PermitRootLogin no then i do
sudo service sshd restart and got redirecting to /bin/systemctl restart sshd.service message i exit and again login to tony@stapp01 then i try to login ssh steve@stapp01 so i got a denial message mean i cant login to any server form stapp01
then i try to do this process to other servers meanwhile my environment crash after this i took new environment and do the same but didnt get same message when i try to jump form tony@stapp01 to steve@stapp02 .
later i start environment again and first of all wrote ssh root@stapp01 i got denial message that i couldnt login to root this happen even i didnt do any step yet then i try ssh tony@stappo1 so i login to that server its mean that ssh root login service is already disable at start of environment
then i do another thing i went to vi /etx/ssh/sshd_config and do PermitRootLogin yes and exit and retry again root@stapp01 but again got denial message i think that config file is not working properly otherwise i would be able to login to root after PermitRootLogin yes and ssh root is already disable at the start . please help i do any thing wrong or it is system mistake

1 Like

Hello,

Since you don’t have root credentials so in both cases you will get permission denied error. You just need to make appropriate changes on all servers which are asked in the question and it should work for you. Also its good to SSH into all server through jump host (that is what its purpose is) however ssh from one server to another should also work if correct credentials/hostnames/IP are used.

Thanks
Inderpreet

1 Like

thanks a lot i just perform the steps and my task is successfull
i follow your guideline and only focus on question ’
thanks

2 Likes