Skip to main content

Linux User creation

How to add a user in Linux ?
useradd is the command to adduser in Linux
useradd is having following option:
(1) useradd
-d "/home/user1" --> user home directory
-c " THIS IS  a test user" ---> Comment about the user
-s "/bin/bash"   --->Shell for the user other option are /bin/csh,/sbin/nologin
-g "Group name"-->Group name for user
User name
#useradd -d /home/dir -c "this is a admin user " -s /bin/bash -G staff user1











Comments

  1. Top 10 Best Online Slots for Real Money - Jacksonville NC
    With the popularity 영주 출장샵 of live casino games, 광주 출장마사지 it is no surprise that casino operators 광양 출장마사지 are offering the best odds and more fun 서산 출장샵 with online slots. 익산 출장샵

    ReplyDelete

Post a Comment

Popular posts from this blog

Password Expiry notification for the users in zimbra 8.x within 7 Days for the email users

This Script will run as cron tab daily basis and it will alert the users for whom password is going to expire within 7 days. It will also alert admin for the users for whom password expired. Kindly replace the domain.com with your own domain name and the  /opt/zimbra/postfix-2.10.3.2z/sbin/sendmail  path to the actual path of postfix #!/bin/bash #Script for zimbra password expiry email notification. # Meant to be performed as daily cronjob run as zimbra user.  # redirect output to a file to get a 'log file' of sorts. # Time taken of script; echo "$SECONDS Started on: $(date)" # Set variables: # First notification in days, then last warning: FIRST="7" LAST="3" # pass expiry in days, we are assuming passwd exiry is 150 Days POLICY="150" # Sent from: FROM="admin@domain.com" # Get all users - it should run once only. USERS=$(ionice -c3 /opt/zimbra/bin/zmprov -l gaa domain.com) #Todays date, in seconds: DATE...

Change of hostname for Redhat Linux/Cent OS /Fedora / Ubuntu / Suse Linux

1. Change of Hostname for Redhat / Fedora / Cent OS Linux  First Check the Current  hostname Login as root or do su. # hostname It will show the current hostname for e.g.testserver new hostname : prodserver go to the file /etc/sysconfig/network # vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=testserver change the HOSTNAME to new name e.g. prodserver & save the file & quit. or prodserver.domain.com After  this we need to reboot the server. For  current change we can use the below mentioned command # hostname prodsever c heck the file /etc/hosts & edit the entry if there is any for the IP Address & Hostname 2. For Ubuntu Linux # vi /etc/ hostname Delete old name and add new name: prodserver.jogi.com Save and close the file. Type the following command: # hostname prodserver.jogi.com     Change the /etc/hosts file with new hostname. 3. For Suse Linux #vi  /etc/HOSTNAME  Delete old name ...

The Script for Temperature Alert using email from the Linux Server (If it Cross 40 c)

#! /bin/bash TEMP=$(sensors | grep "id 0" | cut -d + -f2 | cut -d . -f1) if [ "$TEMP" -ge 40 ]; then echo $TEMP date > /tmp/temp sensors >> /tmp/temp TEMP_BODY=" Hello Helpdesk Team, This is the Temperature Alert Message for ABC Server at DC Location,CITY : $(cat /tmp/temp) Regards, Datacenter TEAM " echo "Subject: ALERT High Temperature for Server at DC Location " "$TEMP_BODY" | /opt/postfix-2.10.3.2z/ sbin/sendmail -t email@domain.com fi In this Script Replace the email@domain.com with Correct Email id and Sendmail path with correct Send-mail path. In this script we are monitoring the CPU Temperature. This Script will work on Linux Server (Red Hat/Centos )