DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 27th July 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default using 'usermod'

I had a problem with the original user, that was setup in the default install, and was not able to login any more, so I deleted that user:
Code:
# userdel garry
,
Ok, then used:
Code:
# adduser
To make a new user, and that worked ok, "garry", can now loging again,...but it also created a new directory,
Code:
/home/garry/garry
The second dir, is empty, when I log in that is where I end up, which is no big deal, but I would rather just have the 1 "garry" dir, instead of 2. The first dir: /home/garry
has all my files, etc and seems fine, but when I try to move or remove, the empty dir ,
again, "garry" can no longer login.
Looking at 'man usermod' :
Quote:
-d home-directory
Sets the home directory to home-directory without
populating it; if the -m option is specified,
tries to move the old home directory to
home-directory.
========
-m Moves the home directory from its old position to
the new one. If -d is not specified, the
new-user argument of the -l option is used; one
of -d and -l is needed.
===
Seems straight forward, but I seem to be not getting the syntax right,...
for example I tried:
Code:
# usermod -d garry /home/garry
Did not work, so:
Code:
# usermod -dm /home/garry  garry
and still no good, also tried a few others , all ways resulted in me needing to start over,..
So anyway, I want to try to get it to where I just have /home/garry , and garry can still log in, but it appears the second dir /home/garry/garry is essential to me being able to login in, so what is the best way to remove that, and just have 1 dir. "garry" ? Thanks
__________________
My best friends are parrots
Reply With Quote
  #2   (View Single Post)  
Old 27th July 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Read the syntax in the man page again. Your use of "-d garry /home/garry" and "-dm /home/garry" are both invalid.

-d must be followed *immediately* by the new directory. Not by the user, not by -m.


Moving files from within /home/garry/garry to /home/garry may cause recursion issues. You might instead use chpass(8) to edit the user's entry, then move files manually.
Reply With Quote
  #3   (View Single Post)  
Old 27th July 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

Ok, thanks
__________________
My best friends are parrots
Reply With Quote
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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:32 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick