- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
When I log in via Serial or SSH I start in this folder.
galileo login: root
root@galileo:~#
How do I set the default directory after login to /media/card/ ?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I don't have a Galileo at hand to verify before posting, but you can try with the standard usermod command (take a look at man usermod):
usermod -m -d /media/card root
HTH,
Fernando.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi BrechtW,
I tested the suggestion provided by FGT and it worked, however I had to change it a little bit. First, I tried to run the command usermod -m -d /media/card root, but I got a message that states that the user root is currently used by a process. I had to create another user, then I ran the command again and it worked. The following are the steps I followed:
- Run the following command to create a new user: useradd test-user. "test-user" is the new username, you can change it.
- Run the following command to set a password to the new user: passwd test-user
- Run the command suggested by FGT with the new user created: usermod -m -d /media/card test-user
- Access the Galileo's console through SSH. Use the new user to login, and then type the password.
- If you run the command pwd, you will check that you are in the /media/card directory
Hope that helps you.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I you are now "test-user", can you than avoid the error that user root is used by a process, and still make /media/card default folder for root user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
That's right.
Now I have a Galileo at hand...
If you are still interested in having the root account with another home directory, just edit the
/etc/passwd
file, and change the line
root::0:0:root:/home/root:/bin/sh
to
root:x:0:0:root:/media/card:/bin/sh
HTH,
Fernando.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you very much @FGT. This is a real time saver.
I changed
root::0:0:root:/home/root:/bin/sh
to
root:x:0:0:root:/media/card:/bin/sh
in /etc/passwd, edited it with vi, pressed insert, changed the path, exited with :wq and it worked!
galileo login: root
Password:
root@galileo:~# pwd
/media/card
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I have a problem now, it doesn't recognize shell commands:
root@galileo:/# halt
-sh: halt: command not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
BrechtW wrote:
I have a problem now, it doesn't recognize shell commands:
- root@galileo:/# halt
- -sh: halt: command not found
Yes, you are right... I realized after my previous post, sorry.
I'm looking at some turn-around, since it seems to be some path problem... but I don't understand why...
Let me try some experiments,
Fernando.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
FGT wrote:
BrechtW wrote:
I have a problem now, it doesn't recognize shell commands:
- root@galileo:/# halt
- -sh: halt: command not found
Yes, you are right... I realized after my previous post, sorry.
I'm looking at some turn-around, since it seems to be some path problem... but I don't understand why...
Let me try some experiments,
Fernando.
Here it is... just a reminder first: all of this is at least "strange"... make sure you make backups of files you change. I usually make
cp .original
just to be able to (hopefully) return to the/some original state...
I do not recall how "standard" linux identifies root user login, but it appears that yocto uses... the home directory! Anyhow, to "recover" the paths root have (and maybe some other environment), edit
if [ "$HOME" = "/home/root" ]; then
to
if [ "$HOME" = "/media/card" ]; then
Furthermore, when I have to change more than one system configuration file I start thinking there should be something more elegant to do... but I usually end way out of elegance... ...
HTH,
Fernando.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks for the solution guys.
I've been looking for the same.
i wanted to set a new user for my client on one on our servers ( my Technical engineer is on sick leave ),i've wasted 3 hours of my life in googling this and at last i found the Linux related answer on intel forum.
Thanks a lot.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page