Тёмный

How to Enable and Disable Root Login via SSH on Ubuntu 

Tony Teaches Tech
Подписаться 111 тыс.
Просмотров 26 тыс.
50% 1

Learn how to allow root SSH login on Ubuntu. In addition to enabling root login via SSH, you will learn how to disable the root SSH permission by changing the PermitRootLogin variable in the /etc/ssh/sshd_config file.
Find more at tonyteaches.tech
Check out my vlog channel ‪@TonyFlorida‬
#ubuntu #ssh #root

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@s.gardner7576
@s.gardner7576 2 года назад
A major point worth mentioning is to make sure there is no "#" sign in front of "PermitRootLogin no" or AllowUsers if needed. Basic but very necessary for this to work. Especially for viewers new to Linux.
@TonyTeachesTech
@TonyTeachesTech 2 года назад
Thanks for pointing this out
@DHRUUVable
@DHRUUVable Год назад
You don't know what this comment has done to me. I can't thank you enough. I was stuck in this from whole day and never noticed that # shouldn't be there. God!! thank you so much.
@suryatejaswi659
@suryatejaswi659 3 года назад
Thanks man i didnot have that allowusers line in the file so i was looking whatsgoing wrong ,thanks again
@TonyTeachesTech
@TonyTeachesTech 3 года назад
You can simply add this line if it isn't there
@jackt6112
@jackt6112 Год назад
I've done this same procedure countless times in UNIX and AlmaLinux and it worked perfectly. I'm doing it in Linux Mint being used as an Internet server and this procedure does not work. I''ve tried from both the public and private vlan interfaces. I can log in as a regular users, but not as root. Yes, sshd has been restarted and I even rebooted. I can RDP in as root and launch terminal, but not ssh as root. Weird!
@alexander.k94
@alexander.k94 2 месяца назад
When i type root@myip it requires password. Any ideas?
@juniorthian2370
@juniorthian2370 3 года назад
Great !!!
@TonyTeachesTech
@TonyTeachesTech 3 года назад
Thanks
@vilaskhadka2626
@vilaskhadka2626 2 года назад
after rootpermit no done if we have to do some major changes in system then how we can login in root.
@TonyTeachesTech
@TonyTeachesTech 2 года назад
What?
@nameeralketti5734
@nameeralketti5734 2 года назад
Thanks
@TonyTeachesTech
@TonyTeachesTech 2 года назад
No problem
@benjibeatsboy
@benjibeatsboy 3 года назад
Hello man, What if the sshd_config does not exist? In my case it does not exit. What can I do?
@TonyTeachesTech
@TonyTeachesTech 3 года назад
Maybe you have to install it first? apt install openssh-server
@benjibeatsboy
@benjibeatsboy 3 года назад
@@TonyTeachesTech thanks I will try
@BMAPS
@BMAPS 3 года назад
Tried this on ubuntu EC2 instance, showing permission denied (publickey)
@TonyTeachesTech
@TonyTeachesTech 3 года назад
I'm not too familiar with EC2 right now, but do you know if EC2's have ssh enabled by default?
@BMAPS
@BMAPS 3 года назад
@@TonyTeachesTech yes they do
@TonyTeachesTech
@TonyTeachesTech 3 года назад
@@BMAPS Is it port 22?
@BMAPS
@BMAPS 3 года назад
@@TonyTeachesTech yes port 22 is enabled
@TonyTeachesTech
@TonyTeachesTech 3 года назад
@@BMAPS In that case, I don't know. I'm guessing there is an issue with your key.
@dennyi.s.7860
@dennyi.s.7860 3 года назад
how to save the line changes ?, i press ctrl X nothing changes
@TonyTeachesTech
@TonyTeachesTech 3 года назад
Press Esc then type :wq and hit Enter ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uE4aljoMBeg.html
@dennyi.s.7860
@dennyi.s.7860 3 года назад
Thanks, well noted. You are the best
@limamey4175
@limamey4175 3 года назад
Hello what program do you use in the video?
@TonyTeachesTech
@TonyTeachesTech 3 года назад
On my MacBook, I am using the built-in Terminal program
@afriendlynorwegianguy3284
@afriendlynorwegianguy3284 3 года назад
i am trying to enable root login via ssh and i have said yes to permitrootlogin thing and restarted the service and server, but it does not alow me to login. any tips?
@TonyTeachesTech
@TonyTeachesTech 3 года назад
Does your /etc/ssh/sshd_config file still have permitrootlogin enabled?
@afriendlynorwegianguy3284
@afriendlynorwegianguy3284 3 года назад
@@TonyTeachesTech yes it does
@TonyTeachesTech
@TonyTeachesTech 3 года назад
@@afriendlynorwegianguy3284 Do you also have AllowUsers root like here 1:37
@afriendlynorwegianguy3284
@afriendlynorwegianguy3284 3 года назад
@@TonyTeachesTech no I don't, il try that tomorrow as it is quite late here In Norway:) thanks for the help
@bluestreak711
@bluestreak711 3 года назад
I followed the instructions and got this to pop up, but I do not see the allowed users part. "#MaxSessions 10 #PubkeyAuthentication yes # Expect .ssh/authorized_keys2 to be disregarded by default in future. AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedPrincipalsFile none #AuthorizedKeysCommand none #AuthorizedKeysCommandUser nobody # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes -- INSERT -- 44,1 41% "
@TonyTeachesTech
@TonyTeachesTech 3 года назад
Oh that's okay. Feel free to add this line if it does not exist
@Eggsec
@Eggsec 2 года назад
So I'm working on an assessment, I was able to find the root password using Medusa. Now, I'm trying to ssh roo@××.xx.xx.xx. I get permission denied (publickey) I think I found my answe watching you video. Is there another way to get my footin with knows ssh credentials?
Далее
How to Add a User with SSH Access on Ubuntu
4:38
Просмотров 34 тыс.
How To Protect Your Linux Server From Hackers!
20:38
Просмотров 301 тыс.
5 Must Have Tweaks to Secure OpenSSH
21:48
Просмотров 29 тыс.
Disable SSH Root Login For Improved Security
5:35
Просмотров 15 тыс.
10 Basic Ways to Secure Ubuntu from Hackers
7:34
Просмотров 45 тыс.
Why Are Open Source Alternatives So Bad?
13:06
Просмотров 645 тыс.
Become a shell wizard in ~12 mins
12:25
Просмотров 251 тыс.
How A Steam Bug Deleted Someone’s Entire PC
11:49
How (and Why) to Disable Root Login Over SSH
5:36
Просмотров 2,3 тыс.
How I installed the HARDEST operating system
34:40
Просмотров 427 тыс.