User mod: invalid field

General support questions
Post Reply
ms3000
Posts: 3
Joined: 2017/07/09 13:23:55

User mod: invalid field

Post by ms3000 » 2017/07/09 13:40:00

Hello,

I added new user:

Code: Select all

adduser newusername
I Set password:

Code: Select all

passwd newusername
When i want to modify user home directory from default to a new folder:

Code: Select all

usermod -d /var/www/html/user/xxx.xx.xx.xx:7777 username
Im getting: usermod: invalid field '/var/www/html/games/_SERVERS/accounts/user/xxx.xx.xx.xx:7777'
How can i make access for user to that directory?
I think that problem is with ":" when i change it like in xxx.xx.xx.xx7777 with out ":" it working but i need folder to be in this format: xxx.xx.xx.xx:7777

Im new in CentOS and i cant find answer,
Thank you

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: User mod: invalid field

Post by TrevorH » 2017/07/09 13:58:39

The : character is the field separator in the /etc/passwd field so setting someone's home directory to a value that contains a : will be problematic. If it's going to work at all (and I'm not sure it will) then you will probably need to escape the : character - i.e. \:

Why do *need* the directory to contain a : anyway?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ms3000
Posts: 3
Joined: 2017/07/09 13:23:55

Re: User mod: invalid field

Post by ms3000 » 2017/07/09 17:00:46

TrevorH wrote:The : character is the field separator in the /etc/passwd field so setting someone's home directory to a value that contains a : will be problematic. If it's going to work at all (and I'm not sure it will) then you will probably need to escape the : character - i.e. \:

Why do *need* the directory to contain a : anyway?
I tried that but is not working.

I installed game panel.
When i create game server, i get folder name of server xxx.xx.xx.xx:7777
That game panel has not FTP integrated.
I want to make ftp user to that directory but when i want to modify user home directory im getting that error.

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: User mod: invalid field

Post by stevemowbray » 2017/07/10 09:58:22

You could make a symbolic link without the : and make that the home directory e.g

Code: Select all

ln -s xxx.xx.xx.xx:7777 /var/www/html/user/xxx.xx.xx.xx
usermod -d /var/www/html/user/xxx.xx.xx.xx username 

ms3000
Posts: 3
Joined: 2017/07/09 13:23:55

Re: User mod: invalid field

Post by ms3000 » 2017/07/10 12:26:21

stevemowbray wrote:You could make a symbolic link without the : and make that the home directory e.g

Code: Select all

ln -s xxx.xx.xx.xx:7777 /var/www/html/user/xxx.xx.xx.xx
usermod -d /var/www/html/user/xxx.xx.xx.xx username 

Thank you very much!
It works!

Post Reply