The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Root admin info deedaz UNIX for Dummies Questions & Answers 2 01-20-2008 04:38 AM
Need HPUX admin commands lost sunanda HP-UX 2 05-09-2007 04:42 PM
Name 10 commands every Linux and Unix admin should know Arkitech UNIX for Dummies Questions & Answers 12 11-10-2006 06:21 AM
Canīt issue commands as root kik_xxx SUN Solaris 1 05-03-2005 06:42 PM
root/admin authorization and PackageMaker ropers OS X (Apple) 4 03-03-2004 09:39 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-22-2005
Registered User
 

Join Date: Dec 2005
Posts: 6
root/admin commands in LINUX

Hi

I am working on LINUX shell scripting. I have root privileges and I know some basic root/admin commands like user creation, modification and so on. Till last week i was able to create users but now i am not able to create users or groups. When I give the command i got an error as
bash: useradd: command not found.

when i searched in bin, I could not see any of the files like useradd or usermod or groupadd

I think someone accidentally deleted these files. If so, is there any way that i can get them back........


Thanks in Advance
naina
Reply With Quote
Forum Sponsor
  #2  
Old 12-22-2005
Registered User
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
maybe your PATH is missing, look into /sbin or /usr/sbin
Reply With Quote
  #3  
Old 12-22-2005
Registered User
 

Join Date: Dec 2005
Posts: 6
Thank you

I found these commands in /usr/sbin, but how should I add them to the PATH?
Reply With Quote
  #4  
Old 12-22-2005
Registered User
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
try echo PATH first:
# echo $PATH
then just export it:
# export PATH=$PATH:/usr/sbin

u should put it in your .profile or .bash_profile
Reply With Quote
  #5  
Old 12-22-2005
Registered User
 

Join Date: Dec 2005
Posts: 6
Thank you

after exporting they are working fine.........

now should I add it in /etc/profile file

as there are no .profile or .bash_profile for root and i found these files user's home directory
Reply With Quote
  #6  
Old 12-22-2005
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
NO.
Naina, adding it to /etc/profile is like giving access to all users to these commands inherently. Well its not that users cant add it themselves. But why would you want a regular user to run a useradd command ( he wouldnt be able to run it anyway unless he has root priveleges). But not only useradd, there are other commands in sbin dir which if possible should be hidden from a normal user. As I said earlier a normal user can always add the sbin to his directory, but if he wants to, let him do it, I suggest you should not do that for him. By adding it in /etc/profile you are doing that for him.
Well that is my way of looking at it. I agree there is nothing that can stop this to be more secure, but when you know that the burglars can break the door and come in your house, you still latch the door in the night, right ?
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #7  
Old 12-26-2005
Registered User
 

Join Date: Dec 2005
Posts: 6
oh....Now I got it

Thank you
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0