manually add new user to Red Hat/Fedora/CentOS

April 19, 2011 Leave a comment

To manually add a new user to a  Red Hat/Fedora/CentOS intall which is utilizing shadow passwords:

As root

  • cp /etc/passwd /etc/passwd.bak (make a back-up copy of your password file)
  • cp /etc/shadow /etc/shadow.bak (make a back-up copy of your shadow password file)
  • cp /etc/group /etc/group.bak (make a back-up copy of your group file)
  • vipw  (to open passwd file in vi)
  • <shift> g  (to get to end of file)
  • a (append at end of cursor)
  • user01:x:501:501:User 01:/home/user01:/bin/bash  (add the new user)
  • :wq  (write file and quit vi)
  • A prompt will indicate that you are using shadow passwords, and do you want to edit the /etc/shadow now.  Answer: n
  • vi /etc/group  (to open group file in vi)
  • <shift> g  (to get to end of file)
  • a (append at end of cursor)
  • user01:x:501:user01 <enter>
  • admins:x:502:user01 (create a new group called admins and put user01 into it)
  • :wq  (write file and quit vi)
  • pwconv  (add the new entry from your passwd file into shadow password file)
  • passwd user01  (set the new user password)
  • (prompted twice for new user password)
  • mkdir /home/user01
  • cp /etc/skel/.* /home/user01 (copy all files from skel to new user home directory)
  • cp -r /etc/skel/.kde /home/user01
  • cp -r /etc/skel/.mozilla /home/user01
  • chown -R user01:user01 /home/user01  (Change the owner of user01 home directory to user01)
  • visudo -f /etc/sudoers
  • After root   ALL=(ALL)    ALL add new line and:  %admins   ALL=(ALL)    NOPASSWD: ALL  (this allows members of admins group to sudo as root, without a password.)
Advertisements
Categories: fedora, how do I?, linux, useful

Change run level on Red Hat/Fedora/CentOS

April 19, 2011 Leave a comment

Change the default run level on Red Hat/Fedora/CentOS distros to boot into server/console mode rather than GUI (from runlevel 5 to runlevel 3).

As root, edit /etc/inittab using vi or vim.  It should be somewhat self-explanatory, however make this change:

# id:5:initdefault:

id:3:initdefault:

Categories: fedora, how do I?, linux

reset root password on Red Hat/Fedora/CentOS

April 18, 2011 Leave a comment

Okay, so you’ve screwed the pooch and need to reset the password for root on your Red Hat/Fedora/CentOS installation.  Assuming that it is a default installation, without hardening, this can be done fairly easily.

This assumes you have GRUB installed.

  1. When the GRUB login screen comes up, hit “e” to edit.
  2. Move the cursor down to the kernel line and hit “e” again.
  3. At the end of the kernel line, add a space and the word “single.”  This will force the reboot into single user mode.  Continue booting the server.  You will automagically be logged in as root.
  4. Run the passwd command to reset root’s password.
  5. Reboot as normal.
Categories: Uncategorized

enable windows manager in linux vncserver

April 14, 2011 Leave a comment

Modify your ~/.vnc/xstartup file to

The default file looks like this:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

Uncomment the “unset SESSION MANAGER” and “exec /etc/X11/xinit/xinitrc” line.  This will start run your default window manager when vnc starts.  Gnome is a lot prettier than the cruddy default gray vnc display with xterm.

Categories: fedora, how do I?, linux

Edit sudoers file in Redhat/Fedora/CentOS

April 13, 2011 Leave a comment

To allow certain users to act as root (su -, or sudo), you must add them to the sudoers file (/etc/sudoers).

The sudoers file must be edited using the visudo command.  See the sudo webpage.

As root:

visudo -f /etc/sudoers

Edit the file to add the correct permissions.  In this case, give members of the group “adm” permission to do just about everything.

%adm     ALL=(ALL)     NOPASSWD: ALL

Save the changes using “:wq”

 

 

Categories: fedora, how do I?, linux, useful

Starting WebLogic managed server from command line

October 14, 2010 Leave a comment

This is any easy one, but I always forget the syntax and have to look in one of my scripts…

To start a WebLogic managed server from the command line, in the domain bin directory – on the physical server where the managed server resides – do:

nohup ./startManagedWebLogic.sh <managed_server_name> t3://<admin_server>:<admin_port> &

 

Categories: how do I?, solaris 10, weblogic

Default WebLogic KeyStore Password/PassPhrase

May 20, 2010 Leave a comment

WebLogic comes with default keystores for client and server security enabled.  However, I have found it problematic to find and remember the passwords/passphrases for the default keystores.

Property

Value

Trust store location

%ORACLE_HOME%/weblogic/wlserver_10.3/ server/lib/DemoTrust.jks

Trust store password

DemoTrustKeyStorePassPhrase

Key store location

%ORACLE_HOME%/weblogic/wlserver_10.3/ server/lib/DemoIdentity.jks

Key store password

DemoIdentityKeyStorePassPhrase

Private key password

DemoIdentityPassPhrase

Property

Value

Trust store location

%ORACLE_HOME%/weblogic/wlserver_10.3/ server/lib/DemoTrust.jks

Trust store password

DemoTrustKeyStorePassPhrase

Key store location

%ORACLE_HOME%/weblogic/wlserver_10.3/ server/lib/DemoIdentity.jks

Key store password

DemoIdentityKeyStorePassPhrase

Private key password

DemoIdentityPassPhrase