Saturday, May 21, 2016

RHEL7 - account creation


Requirement: create account with following specification.

  uid: 1220
  gid: 1500 - oradb
  shell: bourne
  comment: john 12-5nc
  home dir: /export/home/john


# groupadd -g 1500 oradb
# ls -ld /export/hom/
# useradd -u 1220 -g 1501 -d /export/hom/john -m -c "john 12-5nc" -s /bin/sh john


[root@sudhir html]# groupadd -g 1500 oradb1
groupadd: GID '1500' already exists
[root@sudhir html]# groupadd -g 1501 oradb1
[root@sudhir html]# ls -ld /export/hom/
ls: cannot access /export/hom/: No such file or directory
[root@sudhir html]# mkdir /export/hom/
mkdir: cannot create directory ‘/export/hom/’: No such file or directory
[root@sudhir html]# mkdir -p /export/hom/
[root@sudhir html]# useradd -u 1220 -g 1501 -d /export/hom/john -m -c "john 12-5nc" -s /bin/sh john
useradd: user 'john' already exists
[root@sudhir html]# useradd -u 1220 -g 1501 -d /export/hom/john -m -c "john 12-5nc" -s /bin/sh john1
useradd: user 'john1' already exists
[root@sudhir html]# useradd -u 1220 -g 1501 -d /export/hom/john -m -c "john 12-5nc" -s /bin/sh bill
[root@sudhir html]# id bill
uid=1220(bill) gid=1501(oradb1) groups=1501(oradb1)


No comments:

Post a Comment