Difference between revisions of "creating a new user on secureplatform via CLI"

From cpwiki.net
Jump to: navigation, search
Check Point Profressional Services
(version)
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
The following instructions are performed using the admin account in expert mode.  We will create a regular user account with restricted priveleges in cpshell.  Full expert access will be gained by the user by entering expert mode.  It is possible to have a regular user with a bash shell.  The problem is Check Point makes a mess of file and directory permissions, mangles shell environments, ect... This makes creating such a user more work.  That won't be covered here.
+
==version==
  
== fix /etc/profile permissions ==
+
The following instructions are performed using the admin account in expert modeWe will create a regular user account with restricted priveleges in cpshell.  Full expert access will be gained by the user by entering expert modeIt is possible to have a regular user with a bash shellThe problem is Check Point makes a mess of standard linux system file and directory permissions, shell environments, ect... This makes creating such a user more workThat won't be covered here.
Check Point screws up the permissions on /etc/profile in SPLATIn Gaia, it appears to be fixedRegular users should have read access.  Check /etc/profile permissions, if users don't have read access, set it with chmod.
+
  [Expert@chkpfw1]# chmod 644 /etc/profile
+
  
== add user group to ssh AllowGroups==
+
== creating the user account ==
I am being old fashioned, and using the legacy Unix wheel group
+
[Expert@chkpfw1]# sed -i -e 's/AllowGroups root/AllowGroups root wheel/' /etc/ssh/sshd_config
+
  
 +
create user account with the standard linux useradd command...
 +
[Expert@chkpfw]# useradd -d /home/jsmith -s /bin/cpshell -o -u 0 -G root -m jsmith
  
== creating the user account ==
+
== set the user password ==
 
+
1) create user account with the standard linux useradd command...
+
[Expert@argo]# useradd -d /home/jsmith -s /bin/cpshell -G wheel -o -u 0 -g wheel -m jsmith
+
  
2) set the user password
 
 
  [Expert@chkpfw]# /usr/bin/passwd jsmith
 
  [Expert@chkpfw]# /usr/bin/passwd jsmith
 
  New UNIX password:
 
  New UNIX password:
Line 30: Line 24:
 
  Enter new expert password:          <<< if you see this prompt you messed up!
 
  Enter new expert password:          <<< if you see this prompt you messed up!
  
3) edit /etc/passwd...set UID and GUID to zero and default shell to /bin/cpshell.  Failure to set the shell to cpshell will allow the user account root privileges immediately upon loginThis would not be secure.
+
== test new user account access ==
 +
Test the account by connecting to the SPLAT device via ssh. After a successful login, you will have be rescrited to commands available inside the cpshell environmentJust type help at the prompt for list of available commandsRun the "expert" command and enter the expert password to gain full priveleges in a bash shell environment.
  
Example /etc/passwd lines
+
== troubleshooting ==
  
before editing
+
If login failures occur, examine /var/log/secure and /var/log/auth files for error messages.
john:x:1002:1002::/home/admin:/bin/bash
+
what is should look like after editing
+
john:x:0:0::/home/admin:/bin/cpshell
+
  
4) test your login with ssh. after a successful login, execute the "expert" command to gain root. 
 
 
[[category:sysadmin]]
 
[[category:sysadmin]]

Latest revision as of 19:57, 24 May 2016

Contents

version

The following instructions are performed using the admin account in expert mode. We will create a regular user account with restricted priveleges in cpshell. Full expert access will be gained by the user by entering expert mode. It is possible to have a regular user with a bash shell. The problem is Check Point makes a mess of standard linux system file and directory permissions, shell environments, ect... This makes creating such a user more work. That won't be covered here.

creating the user account

create user account with the standard linux useradd command...

[Expert@chkpfw]# useradd -d /home/jsmith -s /bin/cpshell -o -u 0 -G root -m jsmith

set the user password

[Expert@chkpfw]# /usr/bin/passwd jsmith
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

*** note *** the full path is required in the above command because Check Point aliases passwd to...

alias passwd='/bin/expert_passwd'

If you fail to execute the passwd binary by using the full path, you most likely won't be setting the user password, but the expert password... which is actually the password for the root account


Example of the incorrect way to reset a user password from the root (Expert) account:

[Expert@chkpfw]# passwd jsmith
Enter new expert password:          <<< if you see this prompt you messed up!

test new user account access

Test the account by connecting to the SPLAT device via ssh. After a successful login, you will have be rescrited to commands available inside the cpshell environment. Just type help at the prompt for list of available commands. Run the "expert" command and enter the expert password to gain full priveleges in a bash shell environment.

troubleshooting

If login failures occur, examine /var/log/secure and /var/log/auth files for error messages.