LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Problems after changing username (https://www.linuxquestions.org/questions/linux-desktop-74/problems-after-changing-username-603101/)

512upload 11-28-2007 04:55 PM

Problems after changing username
 
I have changed my username (login which I use to enter Ubuntu) and then I couldn't access my documents from the corresponding link, because it tried to open a folder that didn't exist because

after changing the username, the documents folder name stayed the same.

Then, I used Windows to change that folder name to the new user's name. Then, I could open my documents from the link, but even now, some problems persist:

example - when I open a file from a program, it is automatically redirected to the 1st user name documents folder showing this error:

'The folder contents could not be displayed

error accessing 'file:///home/john/Documents': File not found'

I fear for my system's integrity.
What should I do?

rsashok 11-28-2007 05:10 PM

Open console and enter following command:

ln -s old_name new_name

It creates a symbolic link between new* and old* directories. By looking at any of them you see the same data.

512upload 11-29-2007 03:56 AM

What if I would like that only the last name remains with no workarounds?

Is it so difficult to change a username in Ubuntu? In Windows it would be piece of cake.

Thank you.

nx5000 11-29-2007 05:46 AM

It's piece of cake.

You have to use the good tool: usermod.

Did you?

In practice, making complex operations from windows to a disk you also modify in Linux is asking for trouble.

mattydee 11-29-2007 05:47 AM

By the "documents folder" do you mean the link that's on you desktop?

If so, you could just change the link to "/home/new_user/Documents".

I've also found that changing user names sometimes causes problems with permissions, where you have to chown -R the home directory to the new username

512upload 11-29-2007 03:43 PM

I have never used usermod before.
See? That's why Linux is user-unfriendly. In Windows I wouldn't need to know anything.

'By the "documents folder" do you mean the link that's on you desktop?'

No, the link in the top bar.

'where you have to chown -R the home directory to the new username'

Sorry? Don't know what that means.

Gonna investigate on how to use usermod, thanks.

[edited]

I give up. How do I use 'usermod' for my purpose?

nx5000 11-30-2007 07:21 AM

Usually usermod takes care about modifying permissions in an automatic way. It's the first step to do a clean user name change.

man usermod
man chown
man chmod

This is what was suggested here:
Quote:

'where you have to chown -R the home directory to the new username'
chown -R user:group directory
Will assign the directory ownership for user, group.

I guess you can do this with your wm right click (but needs then to be connected as root..)

Then, you would have to probably rename as you did /home/user -> /home/newuser

And then when you login as new user and it works but still some apps kept old links, it's a case by case study, KDE, gnome are maybe different.
How can you compare with window where you get 2 OS suites in the last 5 years, which have both the same window manager (and that you cannot change).

Also you're not supposed to change username everyday. This is an administrative task, not like playing a divx or something; needs a bit of care.

I would have created a new one (adduser or useradd), moved the data and remove the old one.

You can probably still do it.

mattydee 11-30-2007 11:24 AM

Quote:

Originally Posted by nx5000 (Post 2975528)
Also you're not supposed to change username everyday. This is an administrative task, not like playing a divx or something; needs a bit of care.

Well said.

If you could provide your old username (john?), new username and the output from
Code:

ls -l /home
that might help.

mattydee 11-30-2007 07:33 PM

Actually, now that I think about it more, its probably not a permission problem since you say that the link in the "Places" toolbar thingy is incorrect.

I've rebooted in Ubuntu to take a look at things and there doesn't seem to be an easy way to fix this... You can edit applications and system menu, but not the places menu. If these links don't get renamed during a user name change, then this is a serious problem...

Anyone know how to fix this?

PS: If you want to compare Windows to Ubuntu (or linux in general), then compare the price tags as well. If you want to you use linux, then you're going to have to put in a bit of work, you cheap !@#$.

AceofSpades19 11-30-2007 10:02 PM

Quote:

Originally Posted by 512upload (Post 2974853)
I have never used usermod before.
See? That's why Linux is user-unfriendly. In Windows I wouldn't need to know anything.

'By the "documents folder" do you mean the link that's on you desktop?'

No, the link in the top bar.

'where you have to chown -R the home directory to the new username'

Sorry? Don't know what that means.

Gonna investigate on how to use usermod, thanks.

[edited]

I give up. How do I use 'usermod' for my purpose?

http://linux.oneandoneis2.org/LNW.htm
Linux IS NOT windows
read that before you make accusations

exvor 11-30-2007 10:56 PM

Im thinking this is due to permissions. When you create a new user name in Linux it assumes its a diffrent person so files don't belong to the new user. You could have just copied over all the files from the old home directory into your new one. Also there are several configuration files that get put into your home directory for software that you normally don't see because they are hidden. These files you would not want to move to the new user. Saying its easy to this this sort of thing in windows is actually incorrect unless of course your talking about windows 98 or something. Windows xp uses the same sort of security and trying to do something like this in there would cause the same issues unless of course all your users have admin access a thing that makes having permissions pointless.


Anyone who has had a remote user profile deleted on a domain system and then recovered it knows that windows can actually be harder to do what you are trying to do.


Quote:

example - when I open a file from a program, it is automatically redirected to the 1st user name documents folder showing this error:
This is probably due to you having the same invisible configuration files in that directory.

From what I can understand you probably just need to update some of your links that point to the non existent directory. Need to look for broken links.

512upload 12-01-2007 04:18 AM

Of course Linux is not Windows. Windows is user-friendlier, for now. Linux might be free, but it still is finacially supported by many companies.

But talking about what matters, gonna try the 'change back to first user, add user, change files do the newer and delete the old' thing, thank you very much. I thought of it before reading that suggestion, but this way I confirm that it's a good try to fix my mess-up. :)

512upload 12-01-2007 05:19 AM

BIG PROBLEM

I tried to do it, but now I got the $home/.dmrc and 644 error.
I changed the username to the first (john) and then I had to turn off the computer forcibly by holding the power button for 5 seconds, because only the new username was recognized. Now, either having the username folder named as the first user or the new, I can't login to Ubuntu. I'ts stupid. It seems that commanding username changes in Ubuntu produces different results everytime.

See? This is why I hate Linux, even if I'm still trying to 'migrate spiritually' to it from Windows...

I would be glad that you helped me, cause if you don't, I'll have to reinstall Ubuntu... :(

mattydee 12-01-2007 07:46 AM

Quote:

Originally Posted by 512upload (Post 2976479)
See? This is why I hate Linux, even if I'm still trying to 'migrate spiritually' to it from Windows...(

I thought you wanted to stick to "talking about what matters".

This along with your claim that Linux is "supported by many companies" might very well be taken as an insult to those who spend a lot of their personal time trying to develop and improve Linux, and who may otherwise be inclined to help you.

If you want the spiritual experience of being free from Windows, then get a Mac. The marketing/branding folks at the Apple corporation have such an experience already packaged and ready for your enjoyment.

Have a nice day :)

512upload 12-01-2007 08:43 AM

"I thought you wanted to stick to "talking about what matters"."

I wrote that in a different post. But, anyway, it matters what I think about Linux. If I get enough sick of it, then I'll take Windows (pirated, by the way).

"This along with your claim that Linux is "supported by many companies" might very well be taken as an insult to those who spend a lot of their personal time trying to develop and improve Linux, and who may otherwise be inclined to help you."

No, it can't. You're just proving my point that Linux should be better by now, having both many companies supporting it and many people working for it for free.

Mac is not free. And the freeness of Linux is the only thing that attaches me to Linux, for now; since the user experience doesn't.


All times are GMT -5. The time now is 06:16 PM.