1

I want to ask you for help. I installed Ubuntu on my old pc and when I want connect by putty I login as: root and need password. I changed password in Ubuntu terminal by commands:

# sudo -i
# passwd

And still I can't connect by putty (root) Its still write when I put password: Access denied. I watched lot of videos and nothing worked.

I have Ubuntu 18.04.2 LTS

Please help!

Thanks

Danster
  • 11
  • Root access is disabled by default in ssh for security reasons. Using putty, login as yourself using your own password. – user68186 Apr 03 '19 at 14:18
  • Yes, but I need get into a root. I changet etc/ssh/sshd_config form without -password to yes – Danster Apr 03 '19 at 14:21
  • 1
    make sure to restart ssh service after you changed sshd_config: sudo service ssh restart – pLumo Apr 03 '19 at 14:23
  • 2
    Generally, ssh root login using password is disabled for good reasons and I don't see good reasons to enable it. Login as normal user and use sudo su - or just sudo in front of commands you need root rights for. – pLumo Apr 03 '19 at 14:25
  • 2
    "Yes, but I need get into a root. " No you do not. You use your admin account. There is not a single valid reason to use "root" on Ubuntu. You use your admin account to elevate to root. – Rinzwind Apr 03 '19 at 14:25
  • ahh okay and when in all videos using root. – Danster Apr 03 '19 at 14:27
  • All videos are wrong. If all videos tell you to keep the front door of your house open (root access without password) and then go to the market, will you do it? – user68186 Apr 03 '19 at 14:29
  • 2
    @user68186 Depends on the area you live in... – PerlDuck Apr 03 '19 at 14:57
  • @PerlDuck indeed :D – user68186 Apr 03 '19 at 14:59
  • You have o access system as root, because IT IS YOUR SYSTEM, and you are its OWNER. So You may do wherever You want. it is not Microsoft, It is LINUX. – kakaz Oct 14 '19 at 08:31

1 Answers1

1

Notice that to change the root password, you had to sudo first?

By default, Ubuntu is configured in a way so that you can "sudo" and become root user to do things, but you cannot log on as root directly. This is a security issue as the sudo will track who logged on, and it can also restrict what is allowed to be done.

If using putty, when you use "ssh" and try to connect to your old PC, you must use a non-root login. Generally, you would log in using a regular user account, and then once at a shell prompt, just issue the sudo command to do those few commands that you feel the need to run as root user.

There is indeed a way to override this restriction, which usually involves making changes to the sshd_config file. But there is normally no reason for you to allow root logins when the sudo su - root can accomplish the same thing and with more security/accountability.

S. Nixon
  • 402