LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-02-2005, 09:52 PM   #1
kyro_02
LQ Newbie
 
Registered: Jul 2005
Location: Melbourne, Australia
Posts: 12

Rep: Reputation: 0
deluser doesn't work


Ello,

I am using ssh - "deluser -r username" OR "deluser [-r] username" doesn't work.

I am using ssh, can anyone tell me what the command is for ssh to delete a user account & their folder.

Thanks.
 
Old 07-02-2005, 10:06 PM   #2
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
I believe the command is "userdel"
 
Old 07-02-2005, 10:07 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
userdel -r username
 
Old 07-02-2005, 10:07 PM   #4
kyro_02
LQ Newbie
 
Registered: Jul 2005
Location: Melbourne, Australia
Posts: 12

Original Poster
Rep: Reputation: 0
That didn't work :/
 
Old 07-02-2005, 10:08 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Are you logged on as root?
 
Old 07-02-2005, 10:10 PM   #6
kyro_02
LQ Newbie
 
Registered: Jul 2005
Location: Melbourne, Australia
Posts: 12

Original Poster
Rep: Reputation: 0
bash: userdel: command not found

edit: I am logged in as root
[root@mydomain home]

Last edited by kyro_02; 07-02-2005 at 10:11 PM.
 
Old 07-02-2005, 10:20 PM   #7
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Hmm I'm not too sure then. Do you know what the system you're sshing into is running? What's the output of "whoami", "whereis userdel", and "uname -a"? I'm just grasping at things at this point though, maybe someone else knows what's happening.
 
Old 07-02-2005, 10:21 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Did you su? if so, you need to be using 'su -' to have it get root's environment variables. On my system, userdel is /usr/sbin/userdel which is only in root's path. In any case, you could use the absolute pathname to execute it.
 
Old 07-02-2005, 10:22 PM   #9
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
do you have the root's environment i.e. using "su -" instead of "su".
 
Old 07-02-2005, 10:26 PM   #10
kyro_02
LQ Newbie
 
Registered: Jul 2005
Location: Melbourne, Australia
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks guys

Yeah I wasn't properly in the root user

I got another problem though :P

I have two ssh connections open, one in root and on in another one, lets name him "stooge"

I goto the "home" dir. as stooge and do a "ls" and it has stooge userfolder there, and it has another one, lets call him "stud" - I delete him via root user, but he is still there (I try to cd stud - but says permission denied) - how do I get rid of the user & folder of stud (I can't ftp into stud though, and I can't cd stud - either)

Thanks.
 
Old 07-02-2005, 10:28 PM   #11
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
userdel should've removed stud and the directory.
 
Old 07-02-2005, 10:32 PM   #12
kyro_02
LQ Newbie
 
Registered: Jul 2005
Location: Melbourne, Australia
Posts: 12

Original Poster
Rep: Reputation: 0
I forgot to add, I accidently typed in "userdel stud" instead of "userdel -r stud"

What do I need to do to get the folder stud away?

edit:


[root@mydomain root]# userdel -r stud
userdel: warning: /var/spool/mail/stud not owned by stud, not removing
userdel: /home/stud not owned by stud, not removing
[root@mydomain root]# userdel stud
userdel: user stud does not exist

---

But the folder is there, but not accessible :/?

Last edited by kyro_02; 07-02-2005 at 10:36 PM.
 
Old 07-02-2005, 10:39 PM   #13
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
so just go "rm -r /home/stud" (as root)

edit: if it asks for confirmation on every file, you might want to do "rm -rf /home/stud"

Last edited by Ynot Irucrem; 07-02-2005 at 10:41 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Does the mounting of a *BSD partition on linux work work well when rw ? kloss *BSD 3 10-08-2005 02:21 PM
Will Ubuntu Work work With my Wireless Card? PulsarSL Ubuntu 3 10-07-2005 10:33 PM
got ALSA to work in root, need help getting it to work in my user profile ic3 Slackware 2 11-28-2003 10:32 PM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 10:39 PM
customizing Debian (deluser, logrotation, etc) markus1982 Linux - Distributions 0 05-25-2003 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration