LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-28-2021, 03:33 PM   #1
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Rep: Reputation: 83
Kubuntu 20.04 - how to log in as root


There are a bunch of websites that say that under Kubuntu or Ubuntu, you need to create a password for root.
sudo passwd root

I logged out and tried to log in as root and it says that the password is invalid.
Is the user name root or something else?
 
Old 08-28-2021, 03:45 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Ubuntu and most of its derivatives do not use a root user by default. The primary user created when installing the system will have root privileges when you use sudo. If you want to create a root user, did you follow all the steps explained at the link below? Specifically, did you get a message that the password was updates successfully?

https://linuxize.com/post/how-to-ena...unt-in-ubuntu/
 
Old 08-28-2021, 03:48 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Quote:
There are a bunch of websites that say that under Kubuntu or Ubuntu, you need to create a password for root.
I know there are websites that "say" you can create a root password but I do not know of any that "say" you need to create a password.

Yes the root user name is root like all distributions. How are you trying to login? The command should work as far as I know. Also as far as I know/remember as with most desktops these days you can not directly login as root but you can use su to become root versus using sudo. You can also use sudo to access a root shell by using the -i option i.e sudo -i from your admin user.
 
Old 08-28-2021, 08:03 PM   #4
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 83
I ran
sudo passwd root
and I created a password.
It didn't give an error message.

That website says:
"That’s it! You have successfully enabled the root account. You can now log in to your Ubuntu machine as user root using the new password."

So, I closed all programs. I closed Firefox, Kate, LibreOffice Writer.
Then, I clicked on Start -> Leave -> Log Out
Once the log out process is completed, at the bottom right, I clicked on Other.
For the username EDIT BOX, I typed root.
For the password EDIT BOX, I typed what I had typed during the "sudo passwd root"

it says "login failed"

What I am actually trying to do is to copy from one HDD that has some files under /home/jake to this HDD which has /home/jake
How can I do that with Dolphin?

With OpenSuse, I think they had something called root mode Dolphin.
 
Old 08-28-2021, 08:18 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
To build on the above, Ubuntu does have a root user, but does not ask for creation of a root password at time of install. Rather, they expect users to utilize sudo to perform administrative functions. The root user is there, but obscured from user.

When I use a *buntu (outside of VMs), I normally assign root a password in a manner similar to the one above (sudo su, passwd). I can the successfully su to root in a terminal to perform root functions.

Logging into the system as root at time of start-up may be a different issue. I've encountered more than one distro that does not permit root to login to a full session via the graphical display manager, even though they do allow user to su to root in a terminal.

I am not in the position to test this with Ubuntu, but this may be what's happening in this case.

The usual explanation is that this somehow enhances security, which it may, I guess, if someone logs into the GUI as root, and then forgets to log out after completing root's business.

Last edited by frankbell; 08-28-2021 at 08:21 PM.
 
Old 08-28-2021, 10:25 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
As posted with most distributions the login manager does not allow root login to the desktop anymore. I would su to root in a terminal then use rsync to copy the files. I assume you want to preserve permissions?
 
Old 08-29-2021, 06:50 AM   #7
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 83
The thing with rsync and cp is that they might blindly copy everything over.
The old HDD has a different OS. I do not wish to copy everything in folder .local from HDD1 to HDD2 yet there are a few folders in .local that I do want to copy.
The same applies to folder .config (some things in there, I want to transfer over)
and possibly other folders.

Doing this with Dolphin would be much more convenient. I always find clicking, Ctrl-C and Ctrl-V easier.
Also, I get a popup that tells me the transfer speed, the amount of files transferred, the total left, the time left.

“I assume you want to preserve permissions?”

==Permission would have to be changed in this case since HDD1 has /home/jake and HDD2 has /home/john

Why not create a tool to port a user account? is there such a tool?
 
Old 09-07-2021, 05:04 PM   #8
obobskivich
Member
 
Registered: Jun 2020
Posts: 596

Rep: Reputation: Disabled
I'm not fully understanding what your actual task is, but I think fussing with creating a root account is a form of XY problem (https://en.wikipedia.org/wiki/XY_problem) - rethink your approach. As far as transfering files in the GUI, there's three alternatives that may work:

- Do it in a live environment - just boot up a temporary live environment with Ubuntu (or Kubuntu) and mount both partitions/disks/whatevers and have at it.

- Create a user account that isn't called 'jake' if that's causing permissions/access errors for whatever reason - so for example create 'jake1' or 'jake-temp' (but I can't imagine why this is needed; ditto for having root login directly to do the same).

- Mount the 'second' hard drive to some different folder - so its at /mnt/myolddrive which will make its folder path more roughly /mnt/myolddrive/home/jake. If you don't care about permissions (again, I'm not fully following your task here) you can chown that as needed.

You should also be able to open whatever GUI file manager you like via sudo from the terminal, which will run it as root (I tested this with nautilus just to confirm - it works, and its visibly obvious if you have a non-default theme since 'root' generally has no themes setup, so you will get the base UI appearance/decoration on the window). To do this with nautilus (or replace nautilus with whatever you're using (like thunar)):
Code:
sudo nautilus
and then navigate to wherever you like. Make sure to check permissions after you've finished (e.g. with ll) to make sure things are all proper to whatever your task needs when done.
 
Old 09-07-2021, 05:12 PM   #9
GentleThotSeaMonkey
Member
 
Registered: Dec 2016
Posts: 338
Blog Entries: 4

Rep: Reputation: 128Reputation: 128
Quote:
That website says:
"That’s it! You have successfully enabled the root account. You can now log in to your Ubuntu machine as user root using the new password."
Sounds like a phishing site! Now 'they' have your favorite password!
Don't use what you entered anywhere on the internet!

MAYBE....

A way to 'login' as root is: sudo su -

Quote:
I ran
sudo passwd root
and I created a password.
WHERE EXACTLY did you type that sudo? Into some (phishing) dialog box ON the website?

Important: verify by looking at your sudo log (/var/log/auth.log) that you executed the command ON your system. And to verify you did, sudo head -1 /etc/shadow

Was my phishing guess correct?

Last edited by GentleThotSeaMonkey; 09-07-2021 at 05:20 PM.
 
Old 09-07-2021, 05:16 PM   #10
obobskivich
Member
 
Registered: Jun 2020
Posts: 596

Rep: Reputation: Disabled
Quote:
Originally Posted by GentleThotSeaMonkey View Post
Sounds like a phishing site! Now 'they' have your favorite password! (Don't use what you entered anywhere on the internet!

MAYBE....
I think the 'That's It!' is coming from the guide on the posted linuxize link (in post #2) - that's just the language of the guide (telling the reader that they've gotten to the last step), not any sort of live interface between the site and the user's computer for creating a password (which, as you point out, is a very bad thing).
 
1 members found this post helpful.
Old 09-07-2021, 05:29 PM   #11
GentleThotSeaMonkey
Member
 
Registered: Dec 2016
Posts: 338
Blog Entries: 4

Rep: Reputation: 128Reputation: 128
False panic; Kubuntu GUI doesn't allow root login (by default)

https://linuxize.com/post/how-to-ena...ount-in-ubuntu

Oh, you're probably correct. False alarm!

But why doesn't it work? (maybe something IDK; happy to learn)
EDIT: maybe #5: GUI (xdm?) doesn't allow root login. Yup:
https://www.kubuntuforums.net/showth...ow-root-logins

Whenever you enter a correct pwd, and something says: "Invalid pwd", there's a suspicion of phishing.

OT speaking of panic:
Here's a very humorous story of someone being soooo paranoid (over just browsing a site they didn't recognize) that they deleted the whole VM and even worried the host was infected!

Last edited by GentleThotSeaMonkey; 09-07-2021 at 05:51 PM.
 
Old 09-08-2021, 08:28 AM   #12
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by GentleThotSeaMonkey View Post
WHERE EXACTLY did you type that sudo? Into some (phishing) dialog box ON the website?
Of course not.
This is a password that I am setting up on my computer, not some website.
 
Old 09-08-2021, 08:29 AM   #13
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by GentleThotSeaMonkey View Post
But why doesn't it work? (maybe something IDK; happy to learn)
EDIT: maybe #5: GUI (xdm?) doesn't allow root login. Yup:
https://www.kubuntuforums.net/showth...ow-root-logins
OK, sounds like the guy on that kubuntu forum says that it worked. I will try it later on.
 
Old 09-08-2021, 09:21 AM   #14
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
Quote:
Originally Posted by vmelkon View Post
What I am actually trying to do is to copy from one HDD that has some files under /home/jake to this HDD which has /home/jake
How can I do that with Dolphin?
This should have been your original post, and a corresponding topic. I don't believe you can launch dolphin with sudo (or as root if you actually login as root, which you shouldn't do anyway), it will report an error if you try.

To launch dolphin as superuser, use policykit:
Code:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
@VMelkon just paste that into terminal, you'll get GUI prompt for password, then dolphin will open and you'll be able to write everywhere.

Last edited by enigma9o7; 09-08-2021 at 10:14 AM.
 
Old 09-08-2021, 09:50 AM   #15
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by vmelkon View Post
I ran
sudo passwd root
and I created a password.
It didn't give an error message.

That website says:
"That’s it! You have successfully enabled the root account. You can now log in to your Ubuntu machine as user root using the new password."

So, I closed all programs. I closed Firefox, Kate, LibreOffice Writer.
Then, I clicked on Start -> Leave -> Log Out
Once the log out process is completed, at the bottom right, I clicked on Other.
For the username EDIT BOX, I typed root.
For the password EDIT BOX, I typed what I had typed during the "sudo passwd root"

it says "login failed"
As has already been explained root login to the graphical desktop is disabled by default, the password you set using that procedure is used for a text based idea on the console to stop using the sudo, it allows you to login at the console as the root user.

Quote:
What I am actually trying to do is to copy from one HDD that has some files under /home/jake to this HDD which has /home/jake
How can I do that with Dolphin?

With OpenSuse, I think they had something called root mode Dolphin.
Start a terminal use su to become root user typing in the password you set for it then the dolphin hitting enter and seeing if it starts with the root user permissions. Though when you go to access the files again it will be a mess of permissions there. This is what you need to sort on the second drive it is not giving the proper permissions needed when it is mounted. The /home/jake on both instances of it should have the same permissions then it will allow the copying of files between them without any conflict. Use the ls -l /path/to/home/jake on both to see where the permission differ then use the sudo chown -R jake:jake /path/to/home/jake on the second drive to get it working properly, it is likely getting mounted as root owning it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 03:45 PM
Kubuntu newbie: Nothing happens when I try to log into Kubuntu LovecraftX Linux - Newbie 5 06-08-2010 07:41 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
Opennms Logs - where are web.log, web_rtc.log and webauth.log referenced? not_much_of_a_guru Linux - Networking 0 07-12-2006 10:28 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration