Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Wow, I got my new Linux pc yesterday and it's very very fast. It's faster than my new MacBook.
So I go to the user account which also says administrator so I'm presuming that's the root owner?????? and I typed in my name and changed the password. The guy who sold it to me named the password user and the computer user. Yet when I go to the terminal my username and computer is still called user@user
How do I change the root password and computer name?
Administrator != root. Your buddy created a user named 'user' that has some sort of admin privileges. Most likely user is in the sudoers list which will allow that user to execute the sudo command.
As far as changing the password for 'user' and the hostname, you can do it from a terminal. The passwd command will change the password and you'll need to edit configuration files to change the hostname. The configuration files will vary depending on the distribution you're using. You can look at the manpage for the passwd command or use Google.
Depending on the distribution/WM/DE your buddy installed, there will/may be GUI tools to make these changes as well. If you tell us which distro and WM/DE you're using, someone can likely tell you how to use the GUI tools as well as which configuration files you need to edit to change the hostname.
Most everything you might want or need to do can be done from the command line using the command sudo. This is short for 'superuser do'. Because it is so easy to really futz up linux as root (the superuser), running as root is deeply frowned upon (you will get a finger sharply waved at you).
In order to do the things you can't do as a normal user (even as administrator) one prefixes the command with sudu. For example, to add a user, the command is 'useradd'. If one tries to run this command as a normal user, Linux will reply:
useradd: permission denied.
useradd: cannot lock /etc/passwd; try again later.
Performing the command with sudu allows the command to run as though the superuser ran it.
As the previous responder said, there are probably ways to do these tasks using the gui.
Changing password for fred
Enter (current) UNIX (user) password:
Enter new UNIX (user) password:
Retype new UNIX (user) password:
passwd: password updated successfully
Last edited by beachboy2; 02-06-2015 at 03:24 AM.
Reason: error
So you are saying that first I use the CLI to change the sudo password and name of the computer
and then create a new user for myself ( because the Linux police will wave a finger at me if I operate as root)
and then get rid of the user@user account.
If I do this from the CLI I will be officially a geek?
I cannot tell how excited I am.
I will have to research all the CLI commands because I'm as green as grass. Any other advice is more than welcome.
Thanks
Actually sudo stands for su "do". The su is a *nix command that stands for "substitute user". You can su (and sudo) to execute commands as any user, not just the root user. Also, sudo doesn't necessarily allow a non-root user to execute any command, it depends on how sudo is configured. So, if the configuration doesn't allow sudoers to execute the useradd command, they can't execute the command. Also, if you use sudo to execute commands as the root user, you can bork your system just as bad. You still need to understand what the command you're about to execute is going to do to the system!
So you are saying that first I use the CLI to change the sudo password and name of the computer
and then create a new user for myself ( because the Linux police will wave a finger at me if I operate as root)
and then get rid of the user@user account.
If I do this from the CLI I will be officially a geek?
I cannot tell how excited I am.
I will have to research all the CLI commands because I'm as green as grass. Any other advice is more than welcome.
Thanks
Right. You can also try "su root", then type "passwd" to set the root password. Your cli should read root@domain when you do so. Note the root user name is not easily changeable. Type passwd --help to list the commands available. Man passwd will attempt to look up any formal documentation.
sudo is a program in the /bin folder. It is suppose to aid the complex security features (pam).
As for the domain, there may be a file in the /etc folder that contains this info. You can check by searching in files using grep. Grep <pattern> <folder> -R I believe (r for recursive searching). Otherwise try a desktop application that handles system settings. You can search your repository if you have apt or a package manager.
ok, sorry guys, im in over my head. I have to go back and pick up from the start.
I am dumbfounded about the user and admin/ root password thing. please bear with me.
when i first started the computer ( its an old dell refurb from ebay) the desktop came up straight away with no prompt for a password. I then went to download the updates and it asked for a password. I found out from the guy who sold it that the password was 'user'. I could access this from the user accounts from the GUI. there was only one account and it was called user. it was an administer account.
my question is... is this the sudo account, the one that can make all the serious changes, the one i shouldnt be logged in on?
the reason i ask is because i was told i had to use the CLI to access this account. I was under the impression that i had one adminitrater account with its own username and password ( that i only logged in when i needed to change something radical ) and aslo a normal user account that doesnt have access to the sudo command. (which i believe is the command that can access the system)
I am using the very latest ubuntu distro.
the info on this page is very difficult for me to grasp at this level im at. Im sure when i get to know this stuff a bit better Ill say to myself ' what an asshole' but for now I need to understand the difference between the administer account and the normal user account. im also going to post a new thread with just those words on it.
You have one "hidden" system account called root. You only use this to administer the deep guts of your machine.
You have a single user account called "user" with a password of user.
It's a bit unusual, but you have an auto-login to user.
You can gain temporary access to root by using the sudo mechanism.
This is basically what happened when you installed those updates.
Since a password of "user" is easily guessable, I would change the password to something a bit more difficult.
Whoever set up this computer for you did you no favours at all by choosing user for your username, your password and your hostname. It just makes things even more confusing for you.
Just forget about root for the moment and concentrate on sudo.
Jeremy has explained the situation:
Quote:
You have a single user account called "user" with a password of user.
It's a bit unusual, but you have an auto-login to user.
You can gain temporary access to root by using the sudo mechanism.
This is basically what happened when you installed those updates.
At the moment, when you open a Terminal, you should be presented with this:
Code:
user@user:~$
First of all change the hostname to dellrefurb (or whatever you prefer).
This is a fundamental change and in order to do this we must assume temporary administrative rights by means of sudo.
After the $ sign, type (or copy and paste):
Code:
gksudo gedit /etc/hostname
Press Enter.
[sudo] password for user: is displayed.
Type:
user
NB The password will not be displayed as you type for security reasons.
Press Enter.
The /etc/hostname file will contain a single word:
user
Delete user and type:
dellrefurb
Click on File. Click on Save.
You also need to edit the /etc/hosts file and change the 127.0.1.1 entry from user to dellrefurb, then save the file.
Code:
gksudo gedit /etc/hosts
Terminal should now display:
Code:
user@dellrefurb:~$
Next we change your password from user to impossibletoguess (or whatever).
After the $ sign type:
Code:
passwd
Press Enter.
Changing password for user
Enter current UNIX password:
Type user and press Enter.
Enter new UNIX password:
Type impossibletoguess and press Enter.
Retype new UNIX password:
Type impossibletoguess and press Enter.
You should then see:
passwd: password updated successfully.
Close Terminal.
So now you have a username of user, a hostname of dellrefurb and a password of impossibletoguess.
Terminal will display:
Code:
user@dellrefurb:~$
Have a close look at this link, especially the Background Information:
(gedit:15508): Gtk-WARNING **: Calling Inhibit failed: GDBus.Errorrg.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
(gedit:15508): Gtk-WARNING **: Calling Inhibit failed: GDBus.Errorrg.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.