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 03-05-2015, 06:37 AM   #1
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Rep: Reputation: 1
problem logging into live session user ubuntu (on usb stick with persistence)


I am using live ubuntu 14.04lts on a usb with persistence. I tried to create a admin account with password - thinking this would protect my root. However what has happened is I cannot now log back into my live session user account. It never had a password and it is now asking for one. I need to get into the live session account as I had set many settings as I want them. I do not want to lose many hours of work. What I would ideally like to do is get into my live session account - then delete the admin account. I have tried for hours - no luck. Any ideas? Please note I am new to Ubuntu/Linux
 
Old 03-06-2015, 03:19 AM   #2
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Well this is an interesting problem.

First we need to know exactly how you created this admin account.

Precisely what command you used and what the exact name is of this account.

Do you have another stick? Another extremely important question.

What is installed on your computer of other device that you are running this Live Session on.
 
Old 03-06-2015, 10:54 AM   #3
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by widget View Post
Well this is an interesting problem.

First we need to know exactly how you created this admin account.

Precisely what command you used and what the exact name is of this account.

Do you have another stick? Another extremely important question.

What is installed on your computer of other device that you are running this Live Session on.
Thanks for replying.

I created the second account by going into system settings, user accounts, and then completing the window with new account name (I called it Admin) and gave it a password. The user account window now only shows admin in the available users. From my reading of this and other help sites it seems when one creates a new account this effectively stops access to the 'inbuilt' Live session user ubuntu account, which is where all my changes/preferences (to browser etc) have been made.
Incidentally when I click unlock in the user accounts window it brings up a second window titled 'authenticate and one can see the two accounts - live session user (ubuntu) and admin. they have a small arrow to choo se between the two and a box for the password. As said previously the ubuntu user original account either will not accept a password or does not have one.(Sorry no screenshot as I have not worked that out yet).

I have a second stick on which I downloaded the original Ubuntu distro - I then used that first stick to load this live Ubuntu with persistence.

On this Samsung notebook N140 is Windows XP. I have not loaded Ubuntu onto the harddrive. As siad I am usingthe live Ubuntu with persistence off a USB penddrive.

What I need is a meathod how to get into the original Live session User account. It seems to still exist but is somehow locked out by the setting up of the a second account. This might need pointing out on Ubuntu main site for those loading Ubuntu to try out.
 
Old 03-06-2015, 04:11 PM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Let's call your stick that you first put the ISO on "A" and the persistent stick "B".

Most important is can you boot to A?

If so the easiest way to get a usable system would be to create a persistence partition on A. Then put any data from B in the persistent partition on A.

The reason for asking what the OS on the box is was to determine if that OS would be of any help. We can forget that.

If you can boot to A, which I don't know as I have no idea how you put it on there, there are some other rather complicated things that could be done to rescue B. These are not proceedures I would recommend for someone new to Linux.

Users, groups and permissions are not even similar to anything in Windows. Linux is not a monolithic OS as is Windows. Windows has some ways to create semi separate users. Linux can have, literally, hundreds of completely different users using the same OS with absolutely no connection with each other.

They can be set up to not even be able to see that the others exist. Your system is not a single user system and was not when you started messing with it. Your user (ubuntu I think) is the default Live session user. That user was actually created by the one user that has all permissions. That user is Root.

One of the groups in your system, if I remember Ubuntu groups correctly, is admin. There should also be a user "ubuntu", if that is the correct name of the live session default user, and also a group called "ubuntu". There actually is a password for that user but it is "open", which means that there is no content to the password. The live session is set up for auto login so that password is not asked for.

You could chroot into B from A and remove your new account. Hopefully this would resolve the situation. I have never attempted to do that on a live session. It is also posible that you could access the persistent partition on B, find the files that are involved with the creation of the new user and edit or remove them which would be pretty hard to actually do for you.

You would remove the user with the tools that should have been used to create the new user but they are all cli (Command Line Interface) that you are unfamiliar with.

So the biggest thing here is to salvage your data. The Live Session ISO is not all that important. It can be replaced. Grab your data files from B and either put them in a new persistent partion on A or on another stick or a CD/DVD (RW is your friend).

Another thing to backup is your ~/.foo files. These are the "hidden" files in your /home/<user name> directory. You can access them by typing "Ctrl + h" when you have the file manager on A reading the file manager on B. These are the personal configuration files that you modified with every little configuration you did as the live user. You can plug them right into your new persistent partition and be right where you left off.

You do not want any of the system files in the persistent partition. Just files from /home and this should not include any files from /home/admin which if your account was properly set up should exist.

After backing them up completely empty that persistent partition and try booting to B. If this works it will be pretty simple to set up the persistence again, put your /home files back which I assume is where all your data is and you should be back nearly to where you were before adding the new account. You will still need to add any packages you added and do system update/upgrade.

If you can't boot to B you should be able to start over with no loss of data and rebuild the system on either A or B.

I would highly recommend that you get another stick and put one partition on it and use it to store your data on as a back up when you get the system recovered.

I am not sure what you mean by "protecting my root". You do not actually have personal "root". Root owns your user. If you wanted a root password the thing to do would be to open your terminal and;
Code:
sudo passwd root
and add that password. Because of the weird way Ubuntu sets up their system they do not recommend this but many people do it. I never set up a root password when using Ubuntu so can't say if this is actually a problem or simply more Ubuntu FUD. Other GNU/linux distros set up a sudoers file and add the first created user to the sudoers group by default but have the good sense to have a root password too as Linux is a multi user OS and needs that set up to function correctly if you have a family, for instance, with several users all with different accounts and permissions.

On a live session I don't see how this will actually protect anything as there is the default user with complete sudo privileges and no password at all. Anyone can boot to that account. This is what Live Sessions are for.

The best way to protect your System is to remove the usb stick and put it in your pocket.

It should be possible, I have never done it, to create another user that has a password. You could then try that to make sure you can log in as that user. You could then put a password in place for the live session default user.

If you are interested in that there maybe someone that will give directions for it for you or, as I have a Debian Live Session stick that I use for system/data recover that I really need to redo, I could set it up that way and see how it is done before reformating it and starting again with it clean.

Kind of an interesting idea. Should be simple and straight foreward.
 
Old 03-06-2015, 11:27 PM   #5
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Thanks Widget for a great reply. I am certainly a little wiser now. I will answer all your points more fully as I digest them and put them into action. Just for now, I have managed to get into the original 'Ubuntu' user firefox session via the 'admin' account I created. I did this in admin by opening the command line and using sudo -i - u ubuntu.

After the session loaded I used the terminal again entering firefox -p which brought up the profile of the old session (hopefully with all my settings etc) I then using Febe saved this session data in the downloads file of my new admin user account. Now if I open firefox in my admin user I can use febe to restore my old profile.

I am not sure yet it has saved everything. I will check.

I will go more thoroughly into all your suggestions as I still need to take this further and set it up as I want. Thanks to you I now know its a bit more involved but do-able. Incidentally, I am sorry for the unclear references to different sticks. I was writing very quickly. The first stick was 2 GB and I loaded it with Ubuntu ISO. From the Ubuntu site it suggested you could then load onto another larger stick (min 4GB) a Live version with persistence. This seemed ideal for me as I wanted to set things up then if I liked it make the OS permanent on my notebook. (the whole reason for this is to find a replacement for the XP on it). Ok. I will now go away for a day or so and digest the other items you wrote about and come back with further ideas and no doubt many more questions. As you say - it is an interesting problem and unexpected for me coming from a windows environment. But I now see that really Linux is set up for many multi users, and a little thought needs to go into how to set up the user accounts. I hope to go over that with you soon. Thanks.
 
Old 03-07-2015, 03:46 AM   #6
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Sounds like a plan to me.

The command;
Code:
 sudo su <user name>
should switch your user to the one named. In a normal system you usually think of the command "su" as the way to get the root prompt (#). In fact su stands for Switch User and if no name is given then user root is assumed.

If you can do that at the user prompt ($) without the sudo it would be best. Running as root is a bit dicey. Think of running your web browser as opened by root. Do you think that, say, cookies with root permissions is a great idea? Probably not.

You will need to check the permissions on the files you copy that way. May all be owned by root instead of the user. So that will need changed for them to work properly for your user.

If you could open your file manager you would find all those user config files if you type "Ctrl + h". These are your "hidden" files.

Your FF based browser ~/.foo file is located at /home/<user name/.mozilla/firefox/randomstuff.default.

Your best bet would be to save all the ~/.foo files from your final success and use the installer to do a default install on your drive. Then just plug in the ~/.foo files in place of the defaults created by the system when you first boot up and log in.

Have FUN.
 
Old 03-08-2015, 10:27 AM   #7
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Lots of ideas to get through - so here goes. Sorry if it rambles or is unclear.

I am considering installing a completely fresh live persistence version on stick B. (assuming I can store my saved profile elsewhere). Question? The profile I saved - is that just the changes on Firefox browser or does it include file and application changes?

Putting that aside for one moment I want to go through the things you raise (which mainly would be applicable if I keep the current live system).

You mention

'Another thing to backup is your ~/.foo files'

This kind of answers my above question about personal configuration (not just firefox).

I am not sure I made this clear - currently both 'Ubuntu user' and 'admin user' are on USB B.

If I use USB A (the original Ubuntu download I used to get a live persistence version on USB B) to use file manager on A reading the file manager on B - you are suggesting I can retrieve the foo files from B if I understand you correctly? Then create a clean Live persistence USB stick and place the foo (/home/<ubuntu> directory) files and the saved profile from febe and I should be back to square one. Please correct me if I misunderstood this.

I will seek to exclude any /home/admin files or system files from the persistence USB.

Thanks for the reminder I would need to do the system upgrade also. And to backup onto a third USB.

I will now move onto other issues in a second post.
 
Old 03-08-2015, 10:53 AM   #8
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Passwords and root:

I have to admit I am completely confused as to why and where a password should be used on Ubuntu.

I understand that root is the owner of all users. What confuses me is why bother putting a password on a user account if anyone can log on and use sudo to alter everything (or as with Ubuntu there is already a unpassworded default user provided) - what actually caused me all the problems in the first place when I tried to put a password on it!) . I spent hours reading about why Ubuntu do it this way but have to say it all sounded hokum to me. I get the idea that if you are running a huge department with many users - the administrator does not want to hand out 'the' root passowrd (I assume here there would be one) so what they do is give limited sudo rights to all. But it still does not explain how this would stop each user being malicious if they chose. I would be grateful if you could explain any further? I know many people have trouble understanding this. Even experienced Linux users.

Am I right to think you are saying if I make a permanent (as opposed to live) Ubuntu OS on my netbook for instance, I could set up a user account with a password. (Does this still not leave the problem with a default user and also the sudo problem I mention above?)

Whereas with the Live system on a stick - there can be no real protection because of the inbuilt dfault user (non password protected). hence your suggestion to only have removal of the stick in my pocket as protection. ( I would probably lose it !!) But I see what you mean.

With regard to what you say about:

'It should be possible, I have never done it, to create another user that has a password. You could then try that to make sure you can log in as that user. You could then put a password in place for the live session default user.'

This is exactly what I tried to do. I created a second user account 'admin' o the live version and tried to use it to place a password on the default user account 'ubuntu'. On the GUI it does not allow it - It kind off ignores it. On the Terminal - it enters the new password and seems to record it, but it does not show up on the GUI interface. I am still perplexed why Ubunto send out a system without the ability to put a password on the default user account. Unless we go back to the tradition of root and administrators in huge departments not wanting to give out root password as discussed above. This sure makes things complex when we use Ubuntu on our home computers where we are effectively the only user or maybe one or two others.

Ok - end of rant. I will make another post to finish off any other points. Sorry if there is a lot here.

Last edited by jones5; 03-08-2015 at 10:54 AM.
 
Old 03-08-2015, 11:10 AM   #9
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Sorry I do not know how to quote small parts of your post so I have to do it this way:


'The command;
Code:

sudo su <user name>

should switch your user to the one named'

I assume you are saying I can switch from the default user - Ubuntu to my admin user using the command sudo su.

Would this carry over all my settings or is it just a quick way from getting to one user to another?

I agree running as root (which effectively running as default user Ubuntu is) deems dicey for the reasons already stated above. Hence why I tried to set up another account with a password. If I hadn't left all my changes in the Default user it might have worked. If we ignore sudo. It always comes back to that.

If I manage to move my home files to a new install you are saying I will have to change permissions for the files? I guess that will require a password for the default user account? There is not one?

Can you explain this a bit more?

'Your best bet would be to save all the ~/.foo files from your final success and use the installer to do a default install on your drive. Then just plug in the ~/.foo files in place of the defaults created by the system when you first boot up and log in.'

How would this work in a new install of the live System. Which installer are you referring to?

Thanks for your help
 
Old 03-09-2015, 07:38 PM   #10
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by jones5 View Post
Passwords and root:

I have to admit I am completely confused as to why and where a password should be used on Ubuntu.

I understand that root is the owner of all users. What confuses me is why bother putting a password on a user account if anyone can log on and use sudo to alter everything (or as with Ubuntu there is already a unpassworded default user provided) - what actually caused me all the problems in the first place when I tried to put a password on it!) . I spent hours reading about why Ubuntu do it this way but have to say it all sounded hokum to me. I get the idea that if you are running a huge department with many users - the administrator does not want to hand out 'the' root passowrd (I assume here there would be one) so what they do is give limited sudo rights to all. But it still does not explain how this would stop each user being malicious if they chose. I would be grateful if you could explain any further? I know many people have trouble understanding this. Even experienced Linux users.

Am I right to think you are saying if I make a permanent (as opposed to live) Ubuntu OS on my netbook for instance, I could set up a user account with a password. (Does this still not leave the problem with a default user and also the sudo problem I mention above?)

Whereas with the Live system on a stick - there can be no real protection because of the inbuilt dfault user (non password protected). hence your suggestion to only have removal of the stick in my pocket as protection. ( I would probably lose it !!) But I see what you mean.

With regard to what you say about:

'It should be possible, I have never done it, to create another user that has a password. You could then try that to make sure you can log in as that user. You could then put a password in place for the live session default user.'

This is exactly what I tried to do. I created a second user account 'admin' o the live version and tried to use it to place a password on the default user account 'ubuntu'. On the GUI it does not allow it - It kind off ignores it. On the Terminal - it enters the new password and seems to record it, but it does not show up on the GUI interface. I am still perplexed why Ubunto send out a system without the ability to put a password on the default user account. Unless we go back to the tradition of root and administrators in huge departments not wanting to give out root password as discussed above. This sure makes things complex when we use Ubuntu on our home computers where we are effectively the only user or maybe one or two others.

Ok - end of rant. I will make another post to finish off any other points. Sorry if there is a lot here.
I am answering this first because it is easier than your post ahead of it.

When you do a real install you will be asked to create a user in the installation process. This user will be the default administrator (very roughly compared to Windows administrator - Linux gives vastly more power and permissions to do pretty much anything).

You are using a live session. The live session is used for a couple of things and is very good at both. The first is to let you play with the system and see if you can stand it. The second is to do repair and recovery jobs on a broken Linux or Windows installation.

It is not really intended to be a day to day production OS.

A persistent Live Session is very handy if you want to set up a stick for that second purpose and need to add some applications to it and want to keep it up to date. Also handy if you are traveling and want to use any computer you can get on with your OS and save files in a manner that will be easy for you to use when you get home. This may seem strange to you but I don't use a Laptop so it makes sense to me as hauling a desktop with you for a short trip is, to say the least, a chore.

So an install is a completely different animal. On it you can have your user be the only one on there to have any permissions other than the basic ones needed to run the box but those added accounts will not be able to do anything that makes any changes to the system itself. They can only deal with their user account files if set up that way.

The Live session has to have a "default user" set up on it ahead of time. There is no way to boot to a desktop if there is no user. The only user that would be able to get to a desktop, if there was no user created, would be root. This, as you can imagine, is not great way to, say, connect to the internet.

There are live sessions that do just that but they are not generally run with persistence and so any attack or so forth is completely gone once you reboot as the system just reads the OS into ram and runs it strictly from there. Shutting down clears that and you start over with a clean system when you reboot.

On your persistent install of a live session you could create a second user. Once you have that user properly set up you could then make that user account the one to log into. Be somewhat of a pain but not bad.

The point of a Live session is not to be secure. You can easily secure it by shutting down, removing the usbstick and putting it in your pocket.

This is not an installed system. It is, again, a system to be used for some very limited specific things.

Many Linux distros when you install don't even set up a user account during the install process. You create a root password and that is it.

When you boot for the first time you then are asked to create a user account. If you are setting up a number of boxes for use in a house or business that you will be maintaining but other people will be using this is great. You don't even have to know their password as they will create it when they boot the thing up.

Debian based distros all create a user account in the installation process. You are asked to create a root password, then create a user name, then a password for that user. Ubuntu leaves out the root password.

Some of the other respins of Ubuntu use sudo, some don't. Debian by default doesn't. No user can use sudo unless this is set up after install. Only the person that created the install and the root password can do anything requiring root permissions.

You can get a Live session for Debian though. And it certainly uses sudo. Because you have to be able to boot to the desktop as user, not as root, to actually use the system as it is intended to be used.

I have a major problem, personally, with the default setup of sudo. The sudoers file is set up to grant anyone on the sudoers list full root privileges. There is some sense to this as perhaps the installer has not created the root password and this needs corrected by a user using sudo and will need those full privileges to do so.

However, in a multi user situation, say you and I using the same box (or a server booted OS from separate thin client "seats"), it is probably not a good idea for both of us to be able to remove applications from the system.

I, for instance, don't like most music players and prefer DeadBeef. I look at the installed packages list and see some other music player installed. Waste of space so I remove the package. You now come and have a "chat" with me, perhaps with a ball bat, because I have removed the player you use.

Sudo can be set up very precisely. We could both be able to install packages but one, or even both of us, would not be able to remove a package. In a business you may want your secretary to be ablle to create but not delete accounts so that he/she could set up a user account for a new hire.

But the sudoers file is set up with the all:all language. That is all users and all groups (user:group). So this is what people think sudo is for because they don't bother to look into it. It is there to create a super user. This is a user with extra permissions but short of root permissions. Root is not a super user. Root is root and that is above any super user.

Ubuntu, assuming the average user is an idiot, doesn't create a root password so as not to confuse the poor soul. The direct result of this is enforced ignorance because they have no idea that they could investigate further.

I don't have any sudo rights on my installs at all. No users do. I have a root password that only I know. If I up and croak any other user is going to have to deal with that problem on their own. This is actually not all that hard to do, easy even, but you have to know how. (Hint - a live session is your friend in this situation)

One word of caution, and they may have come to their senses and fixed this. The last time I had Ubuntu installed (12.04-testing)if I booted to recovery mode and it got to the end of booting I was presented with a # rather than a $ prompt. Recovery mode boots to a tty login. You can login as user and use sudo or log in as root. On Linux Mint, based on Ubuntu, you are asked for your user password and can then use sudo if you need elevated privileges. But Ubuntu just handed the user booting to recovery a full blown root prompt. I most certainly hope this is no longer the case.

If it is still the case I would recommend using any other distro that has sense enough to to do that.
 
Old 03-09-2015, 07:55 PM   #11
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by jones5 View Post
Lots of ideas to get through - so here goes. Sorry if it rambles or is unclear.

I am considering installing a completely fresh live persistence version on stick B. (assuming I can store my saved profile elsewhere). Question? The profile I saved - is that just the changes on Firefox browser or does it include file and application changes?
If you just keep the ~./mozilla file all that does is save the mozilla configuration for that user.
Quote:
Putting that aside for one moment I want to go through the things you raise (which mainly would be applicable if I keep the current live system).

You mention

'Another thing to backup is your ~/.foo files'

This kind of answers my above question about personal configuration (not just firefox).
Those files are specific to a user. Every user should have a /home/<user name> directory. All their little configurations of applications that they use are stored there.

If you and I use the same box we would both have our own /home/<user name> directory and our own ~/.foo files. To stick with FF for this example; you and I have different interests so we have different bookmarks we want to use. When I log in I log in to be working from my home directory and will have my bookmarks.

You will have your bookmarks. We will both be using the same FF package but what we see when using it could be quite different because I may use a different theme and icon set or even a different DE than you do.

The ~/.foo files are read after you log in and the system reads the appropriate user directory. This is the slight lag between hitting enter and the desktop coming up. The rest of the system is already to go.
Quote:
I am not sure I made this clear - currently both 'Ubuntu user' and 'admin user' are on USB B.

If I use USB A (the original Ubuntu download I used to get a live persistence version on USB B) to use file manager on A reading the file manager on B - you are suggesting I can retrieve the foo files from B if I understand you correctly? Then create a clean Live persistence USB stick and place the foo (/home/<ubuntu> directory) files and the saved profile from febe and I should be back to square one. Please correct me if I misunderstood this.

I will seek to exclude any /home/admin files or system files from the persistence USB.
You want to ignore completely the /home/admin directory. This is the account that screwed your system so I doubt you have done a lot of customization from that account and would just scrap all of it.

You don't want any system files because they have system wide configuration files. Ones that affect all users. These are totally screwed on your system.
 
Old 03-09-2015, 09:36 PM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
First; If you use the "Post Reply" button instead of the "Quick Reply" box you will see a number of options at the top of the reply box. One of them is for quote tags and one is for code tags.

I am not sure how you use them but assume it is pretty easy. I find typing them faster and it works in the Quick Reply box. To start any sort tag you put that word, code or quote, inside [x] inplace of the x. Type or paste what you want inside the tags and then end with [/x] again with code or quote in place of the x.

You don't need to use sudo to Switch User (su). This can be done at a normal user prompt ($) because it is switching you to another normal user. You will be asked for that users password. Can't show actual results as my added users account has expired. Clem is a user that is for trying things out on. Like sudoers file configuration and I have been neglecting to log in as Clem. Will need to get Root to straighten that out. But it works like;
Code:
sam@lounge:~$ su clem
Password: 
Your account has expired; please contact your system administrator
su: Authentication failure
sam@lounge:~$
If that damned clem had been maintaining his account that would look like;
Code:
sam@lounge:~$ su clem
Password: 
clem@lounge:~$
Note that the ~$ in sam@lounge:~$ means that I am working from /home/sam and in the other case from /home/clem. This really is different.

If I ran wget -c /media/LinuxInfo/Linux/ISO/debian-7.7.0-amd64-netinst.iso from either of those prompts the resulting ISO will end up in the home directory of the user to whom the prompt belongs.

If I were to want to look at package information at the clem prompt about Gimp I would have to type;
Code:
apt-cache show gimp
because clem doesn't have the aliases in his ~/.bashrc file that sam does. As sam I would be alble to;
Code:
ac show gimp
Those are just a small indication of the differences in different cli "environments" and show some of the things that can be different between users.

If for some reason I wanted to use some of Clems bookmarks I could su to clem, and at the clem prompt type "iceweasel" to open the Debian clone of FF right here in my sam account and be using clems default profile.

But I need to know clems password to do that. This is why different users have different passwords.

It is also why, if you don't get scared off of Linux, you can use one /home partition and have several separate different installs of any Linux or BSD distros on their own / partition and not have them conflict. Each has to have a unique user name. Then when you log in you get the correct ~/.foo files.

I have several Victim installs. They are strictly for experimentation that could, and frequently does, break them. Currently there are 4 of them, 3 Debian based and one Manjaro. If they all used the same user name there would only be one /home/<user name> directory. The aliases I have in the .bashrc files on the Debian based ones for package management would be useless for the Manjaro user. And OpenBox config for Manjaro is not going to do much good for the Xfce configuration of 2 of the Debian installs and may well conflict with the OpenBox configuration in the Debian OpenBox install. As they all have different users, however, it is no problem at all and saves an awful lot of space.

I mention this because you seem to have some tendencies that I have.

When I first installed, indeed first saw Linux in person, it was with Ubuntu 8.04. My wife and I had bought our second computer after using one built in 98 for us. This of course ran W98. It finally packed it in in 08. So she goes and buys a Dell with Vista installed. W98 was better. New box was a quad core 2.4GHz compared to the old P2 at 350MHz. Ran slower than the old one for everything we used daily. Spread sheets, word processing and so forth.

Bought another HDD and installed Ubuntu. I had become pretty adept at fixing problems in Windows. Still not too bad at it on my Dreaded Mother in Laws Vista box. Thought I new what I was doing and really loved the power Linux gave me over the computer. This resulted in breaking 8.04 5 times the first 7 days.

I thought this was great fun and learned a lot in a hurry. My wife, however, was not amused. She has this strange idea that your OS should actually work all the time.

On that 7th day, I did my last reinstall of 8.04 on most of the hard drive. Then I installed 8.04 on the rest of the drive. I used that second install more than our production install. I did anything that was thought of to do to the production install on Playtime (host name of the second install) first. I did package update/upgrade chores on Playtime first even.

Also learned that installing on / and /home partitions is vastly superior to installing only on /. Converted the production install (much easier to simply install on more than one in the first place) to / and /home. Actually still have that /home partition on this box but with Squeeze (Debian 6) running on the / partition.

I tinker on things. Most things. An OS is easy to tinker on and you learn a lot doing so. You also learn, many times, that you didn't fully understand what you were doing. While this is a very good way to learn things, at least I think so, it can be very inconvenient in a lot of ways.

You really don't need a lot of room for a / partition. Most recommend 10gigs. I think that is small as I install a lot of stuff to try it out. I would go for your main install with 20gigs. Make your /home partition fairly small something like even 10 gigs. Make another partition of 10 gigs and leave it alone. Use the rest of your drive for one more partition for data. This will max out your 4 partition limit on a MSDos Partition table which your box is using.
You need another one for swap. Make your first partition, the 20gig /, a primary partition. Then create one large "extended" partition. This is a hacked version of a primary partion that allows you to make "logical" partition within it.

Put your /home, empty 10gig (for a 2nd /), data partition and your swap partition in the extended partition. Set this up ahead of doing the install using your live session. Format all of them to ext4 except the swap (obviously).

You can then use the live session to install your system. Chose the manaul option when it gets to partitioning. That way you can really easily point the installer at the partition you want to use. Install on the 20gig / and the /home partition. You will see that there is a place to tell the installer to format the partitions or leave them as is. You can take your pick on this first install as they are already formated.

Then just do another install. Point the installer this time at the small / partition and the same /home. Use a different user name. DO NOT LET THE INSTALLER format the /home partition which would wipe out your first installs /home/<user name> and thus screw that install.

Installer will format the swap. You only need one swap partition. You only use one OS at a time they will share nicely. Keep most of your data on the data partition.

I know one guy on another forum who uses 10gig / partions and a 3gig /home for each install. Has a huge data partition that mounts with each OS. All you really need that /home for is the ~/.foo files. I like to actually keep some files there though but he doesn't. He will not share a /home because he refuses to use any thing but one user name for all his installs.

I think he is nuts. He knows I am nuts. We both agree that keeping your data on a separate partition is generally a good thing. You can, for instance, then set up your music library on the data partition. If you use the same music player then when it is set up on one install you can put that /home/sam/.config/deadbeef (in my case) in all your installs. It is set up to read the /media/FontOFiles/Fount/Music file as the source of music. That path is exactly what every other install is looking for too.

You just need all installs to have the data partition mounted in the same place under the same name as the other installs. This is all controlled by your /etc/fstab file and you will need the "mount point" directory to exist where ever you put it. That for things like this is usually in your /media directory.

The installer should be able to set this all up for you in the manual partitioning section. You click on a partition and there is some (haven't used an Ubuntu installer since late 2011 when 12.04-testing started) screen that comes up to configure the partition, click on the data partition and you should then be asked a number of things, NEVER let the installer format the thing, you will be asked where to mount it and given a list to choose from, one option should be to write it in yourself. So just enter /media/Data (or what ever you want to call that mountpoint).

When you boot the data partition should mount just like any other part of the install, the mountpoint will have been created and the fstab written to handle it.

This also gives you only one thing you really need to backup to protect your data.

As this will be your first install experience and you have lots to learn keep things simple. Do not use LVM (logical volume management which is primarily intended for servers but is extremely popular with Ubuntu users for some reason). Do not encrypt anything. You WILL loose data judging from all the treads crying out for help about just that. Neither is that hard to deal with as far as I can see. I know encryption is not hard to deal with but you have to take some precautions on where you keep your keys and how you keep them so that they can be used to get to your data if, for instance, your drive packs it in but you can do a recovery on it. Great, now you have saved your data but it is encrypted and you can't use it. Avoid those 2 things, they are common pitfalls for new Ubuntu users.

Encryption is silly unless you are really paranoid for some really good reason like you are planning to invade some other country or over throw your own government. Or running a slavery trade business. Other than that, stick with good password protection and avoid letting people use your account.

I like a system with no sudo premissions for anyone but there are advantages to using it as it can help avoid making terrible mistakes. I like to have an account that has no permissions to see any other files than the /home/<user> directory which belongs to that account. Can't even see the file names anywhere else.

I also like my bios access to have a password although many people know how to bypass that. Many more don't know how. Same with the grub boot loader. It can be password protected. Agian it is not something that can't be gotten around. But they have to know how.

All security, anywhere, is not aimed at perfection. It is aimed at making your business, house, barn, car, or computer more trouble to crack into than the next guys what ever is. So they go and do his instead.

Perfect security on a computer would be one that is installed with all the bells and whistles of security, not connected to the internet, kept in a vault, and the combination to the vault forgotten, and the door welded shut. Hell, encrypt it while you are at it.

You can play with encryption when you get some other things figured out. And LVM too. I, personally, don't see the advantage of it. Can to some extent on a server but with sensible planning and an efi instead of MSDos partition table I just don't see the point on a personal use box. But I do a lot of things just because I can so that right there is a great reason. Just wait before doing it.
 
Old 03-10-2015, 04:30 PM   #13
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
A lot to deal with - so as before I will break down the details into bite sized chunks. Thanks for the continued help by the way.



Quote:
If you could open your file manager you would find all those user config files if you type "Ctrl + h". These are your "hidden" files.

Your FF based browser ~/.foo file is located at /home/<user name/.mozilla/firefox/randomstuff.default.

Your best bet would be to save all the ~/.foo files from your final success and use the installer to do a default install on your drive. Then just plug in the ~/.foo files in place of the defaults created by the system when you first boot up and log in.
I have now used your method of switching between user using su. It works well.

I am doing the following in Terminal (but having problems locating the Directories and files to copy.

1
Trying to get access to the FF foo (profile files) to copy
This may sound stupid but I entered:

/home/<user name/.mozilla/firefox/randomstuff.default.

and Terminal couldn't find the file or directory. (Of course I inserted 'ubuntu' instead of <user name> as ubuntu was the default account).
Is it a hidden file? Do I actually use 'randomstuff' in the line?

2
I am trying to find and copy the user configuration (foo) files for the old Ubuntu user account as you discussed above.

I get as far as ubuntu@ubuntu:/home$

but then get stuck. What do I need to type after the above to get to the right directory or file, to see it and copy it? (I assume from what you have said the files are hidden. Ctrl + H would be valid in the GUI but not here in Terminal?)

The reason I am persisting with the above (even though I suppose I could do without the modifications I did in the original user account)is because it is good practice for me to be able to use terminal and understand how the user accounts work.
I will post further on the other things you mention above.

Last edited by jones5; 03-10-2015 at 04:39 PM.
 
Old 03-10-2015, 06:23 PM   #14
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
You are doing fine. Your problem is one that I am familiar with. You are damned good at running Windows. There is less similarity than you would believe. Been there. Done that.

I am, I admit, rather jealous. I am really good at breaking systems. I have never, ever broken a live session. Congratulations.

You learn a lot doing that sort of thing. At least I do.

On the cli the basic command structure is;
Spaces are breaks. Where the break is moves you to the next part of the command.
The first thing that is put in the command is the application to do the job
The second may be some options but in a simple command will be the job it self
The third will be where the job goes.

That is over simplified and really refers to your attempt to copy to another file.

In this case I just copy the /home/sam/.mozilla/firefox/wucdkmgr.default directory to my Downloads directory using;
Code:
sam@lounge:~$ cp -R /home/sam/.mozilla/firefox/wucdkmgr.default /home/sam/Downloads
The second part of that command modifies cp (copy) to copy the directory recursively (get all the contents)

Running;
Code:
sam@lounge:~$ ls ~/Downloads
then lists (ls) the contents of /home/sam/Downloads in very pretty colors to indicate different types of file (everything is concidered a file under this system) as this file is a directory it shows up as blue but it is there. Here is just the last few results;
Code:
countryside-code.pdf                                                ws_supply508.pdf
davechild_linux-command-line.pdf                                    wucdkmgr.default
Deline4.jpg                                                         xsplash
Dina-Goldstein
sam@lounge:~$
The file in question is second in the second column.

The easy way to do that is to high light the file, use the right click to pick the option "copy" and then go to where you want it and use the right click menu to "paste". Which basically does the same thing using the same cli command.

There are times the cli is more convient and if working in black screen situation is the only option. And it is rather fun anyway. For the move I made I would have used the mouse normally.

There is also the command mv (move) which will remove the file from where it is and put it where you tell it too.

Actually there are hundreds of commands. You may be interested in an introduction to linux that is pretty good;
https://www.edx.org/course/introduct...ionx-lfs101x-2

That is from the Linux Foundation. This is the second time they offered it. I took the first one to see how it was. Good information but pretty poorly presented I thought. So signed up for this one which has a lot of very good improvements.

I think it would be a good thing for you. Kind of get you better oriented. Give you enough information to get into more trouble.

Simple, self paced, not sure when the end of it is. Not hard at all. You already have more experience than they try to gear the course for so it should be no problem. Should give you a good understanding of a broad range of things but not a lot of specifics about anything. That is not a complaint at all, it is billed as an introduction and, as such, is very complete.

The problems with the first round is that this is a course they have used for years but in a class room type setting and porting it to a web course was a challenge that I think they are very rapidly learning to do. This round is just so much better it is hard to believe.
 
Old 03-10-2015, 06:55 PM   #15
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,568

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
Quote:
/home/<user name/.mozilla/firefox/randomstuff.default.
randomstuff is just an example. To find out what that directory is actually named do:

Code:
ls -ld /home/ubuntu/.mozilla/firefox/*.default
if your user is actually ubuntu. This should output the actual directory name as well as permissions, owner:group.
The dot/period before mozilla means it is a hidden file. I haven't read the whole thread so I'll leave thing with you and widget. Good Luck.
 
1 members found this post helpful.
  


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
centos live usb and no persistence !!! TheOne...More Linux - Software 1 06-13-2013 04:50 PM
Problem with persistence with Ubuntu from USB. villmatic Linux - Laptop and Netbook 7 04-16-2013 11:43 AM
Live usb help; Persistence abcde597 Ubuntu 4 10-23-2012 07:27 PM
usb stick with persistence won't boot Dell laptop nutjob16 Linux - Laptop and Netbook 10 03-10-2011 04:28 PM
persistence in debian live usb ciden Linux - Desktop 0 09-09-2007 12:18 PM

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

All times are GMT -5. The time now is 08:59 PM.

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