Difference between revisions of "Adding users"

From ArmadeusWiki
Jump to: navigation, search
(Changing password)
(Make the change effective for all your future rootfs build)
Line 33: Line 33:
  
 
==Make the change effective for all your future rootfs build==
 
==Make the change effective for all your future rootfs build==
* Transfer ''/etc/passwd'' and ''/etc/shadow'' for your APF to your PC (here 192.168.0.2):
+
* Transfer ''/etc/passwd'' and ''/etc/shadow'' from your APF to your PC (here 192.168.0.2):
 
<pre class="apf">
 
<pre class="apf">
  # tftp -p -l /etc/passwd 192.168.0.2
+
  # tftp -p -l /etc/passwd -r passwd 192.168.0.2
  # tftp -p -l /etc/shadow 192.168.0.2
+
  # tftp -p -l /etc/shadow -r shadow 192.168.0.2
 
</pre>
 
</pre>
 
* Copy the transfered files (assuming your [[Communicate#TFTP_server|TFTP]] points to ''/tftpboot/'') to your Buildroot's rootfs skeleton:
 
* Copy the transfered files (assuming your [[Communicate#TFTP_server|TFTP]] points to ''/tftpboot/'') to your Buildroot's rootfs skeleton:

Revision as of 17:40, 1 October 2009

It's not always a good idea to run all its embedded applications as root user or it may be mandatory to allow other users than root to remotly connect to an embedded system.

This page will explain you how to add new users on your board.

Create user account

  • Use the adduser command (here the new user is named guest):
 # adduser guest
 Changing password for guest
 New password:
 Retype password:
 Password for guest changed by root

Changing password

  • If logged as guest you can change user's password with:
 $ passwd
 Changing password for guest
 Old password:
 New password:
 Retype password:
 Password for guest changed by guest
  • If logged as root you can change all other users password with:
 # passwd guest
 Changing password for guest
 New password:
 Retype password:
 Password for guest changed by root

Make the change effective for all your future rootfs build

  • Transfer /etc/passwd and /etc/shadow from your APF to your PC (here 192.168.0.2):
 # tftp -p -l /etc/passwd -r passwd 192.168.0.2
 # tftp -p -l /etc/shadow -r shadow 192.168.0.2
  • Copy the transfered files (assuming your TFTP points to /tftpboot/) to your Buildroot's rootfs skeleton:
 $ source armadeus_env.sh
 $ cp /tftpboot/passwd buildroot/target/device/armadeus/rootfs/target_skeleton/etc/
 $ cp /tftpboot/shadow buildroot/target/device/armadeus/rootfs/target_skeleton/etc/
  • Create user's HOME directory (here /home/guest):
 $ mkdir -p buildroot/target/device/armadeus/rootfs/target_skeleton/home/guest
  • Now each time you will build your rootfs you will have the new user account active