How to change the Computer name that appears in the terminal

2

0

So I got a laptop from my college that has Ubuntu 12.04 LTS and Windows 7. They handed over the laptop after reformatting the computer themselves.

When I open the terminal I used to see

collegename@collegename:~$ 

which I managed to change to

collegename@Sid 

from the

sudo gedit /etc/hostname

and switched off the Auto Login So I could see Sid at the top left corner of the login page.

I want to change collegename to user or ubuntu or something else which does not remind me of my college.. just like it appears

"root@username:~$" 

for the root user. What should I do? I am not the root user.

I tried

sudo gedit /etc/hosts 

and changed collegename to myname beside 127.0.1.1 but have not checked whether the name has changed or not.

The bluetooth name is also not a default, they've changed everything they could and it's the same for all students.

Siddharth

Posted 2012-10-14T03:57:07.310

Reputation: 90

1Whatever you changed in the hosts file... Change back now. – Simon Sheehan – 2012-10-14T04:07:47.543

Answers

2

The name which appears before the @ is your username. Create a new account or rename your account to something else.

Unless you are very experienced in managing user identities, it is far simpler and more likely to be correct to create a new account.

Depending on the umask of user collegename, you might want to set world read and execute permission to all your files:

 $ collegename@Sid:~$ chmod -r 755 ~/*

That way you can get full access to the old username from your new one.

To create a new account, see this.

wallyk

Posted 2012-10-14T03:57:07.310

Reputation: 1 306