LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-09-2017, 11:51 AM   #1
ms3000
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Rep: Reputation: Disabled
User mod: invalid field


Hello,

I added new user:
Code:
adduser newusername
I Set password:
Code:
passwd newusername
When i want to modify user home directory from default to a new folder:
Code:
usermod -d /var/www/html/games/_SERVERS/accounts/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
 
Old 07-09-2017, 01:52 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by ms3000 View Post
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
Welcome to LQ!

The colon is the delimiter in /etc/passwd, so it makes sense that usermod would choke on having it in the directory name.

I've tried quoting, escaping (\: ) and doing both without success.
I think you're out of luck.

Generally speaking, special characters in directory or file names is not usually a good idea. Please discuss why you "need" a colon in the directory name. Maybe we can help find another solution.

Last edited by scasey; 07-09-2017 at 01:55 PM.
 
Old 07-09-2017, 02:00 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I suggest you read some man pages. These programs for starters
usermod
mv
chmod
chown
ln

You can make ''/var/www/html/games/_SERVERS/accounts/user/xxx.xx.xx.xx:7777' a symlink using ln -s and that's as good as making it a directory. The xxx.xx.xx.xx:7777 bit looks awfully like an IPV4 network address with a port number and that not a directory you should be making imho. Find another way of doing it.
 
Old 07-10-2017, 07:32 AM   #4
ms3000
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Yes,
Solution of the problem is:
Quote:
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
 
  


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
[SOLVED] Amavis: invalid header: all-whitespace header field deathsfriend99 Linux - Server 2 02-16-2012 09:41 AM
Found invalid password for user: 'root@localhost'; Ignoring user charu Linux - Server 1 11-18-2010 04:33 AM
How to block HTTP requisitions with invalid/blank http referer field brgsousa Linux - Software 2 10-18-2010 02:49 PM
single user mod question mokku Linux - Newbie 2 11-07-2008 01:40 PM
squirremail ...it says invalid user or invalid password. rnj Fedora 9 10-25-2004 09:56 PM

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

All times are GMT -5. The time now is 04:28 PM.

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