Operating System - HP-UX
1748199 Members
2714 Online
108759 Solutions
New Discussion юеВ

Re: Using usermod from doing ssh from master server

 
SOLVED
Go to solution
Mike_305
Super Advisor

Using usermod from doing ssh from master server

Hello,

I am trying to change GECOS field in several servers and several users account.

This is what I a doing.

ssh roxyio usermod -c Rodnry S. Bryant,134234,, pdstest

and I get this error.

User name must be specified
Usage: usermod [-u [-o]] [-g [-G [, [-d [-m]] [-s ] [-c ] [-f <inactive>] [-e <expire>] [-l <new logname>] <login><BR /><BR />If I user following then no error.<BR /><BR />ssh roxyio usermod -c Rodnry-S.- Bryant,134234,, pdstest.<BR /><BR />The only difference is "-" in the name.<BR /><BR />any Idea on how to fix this.<BR /><BR />Appreciate your help in advance.<BR /><BR />Regards,<BR /><BR />MP<BR />
If there is problem then don't think as problem, think as opportunity.
8 REPLIES 8
Steven Schweda
Honored Contributor

Re: Using usermod from doing ssh from master server

> The only difference is "-" in the name.

The significant difference is eliminating the
spaces in the argument. Try quotation?

-c 'comment with spaces'
rariasn
Honored Contributor

Re: Using usermod from doing ssh from master server

Hi,


# ssh roxyio "usermod -c Rodnry S. Bryant,134234,, pdstest"

Rgs,
Robert Salter
Respected Contributor

Re: Using usermod from doing ssh from master server

I think Steven meant

# ssh roxyio usermod -c 'Rodnry S. Bryant,134234,,' pdstest

Quote the comment section.
Time to smoke and joke
Mike_305
Super Advisor

Re: Using usermod from doing ssh from master server

Hello,

I tried the suggestion and still getting the same error.

Any idea.

ssh roxyio usermod -c 'Rodnry-S.- Bryant,134234,,' pdstest

ssh roxyio "usermod -c Rodnry-S.- Bryant,134234,, pdstest"

User name must be specified
Usage: usermod [-u [-o]] [-g [-G [, [-d [-m]] [-s ] [-c ] [-f <inactive>] [-e <expire>] [-l <new logname>] <login><BR /><BR />Appreciate your and Happy New Year.<BR /><BR />Regards,<BR /><BR />MP
If there is problem then don't think as problem, think as opportunity.
Mike_305
Super Advisor

Re: Using usermod from doing ssh from master server

In my last reply, I mean to say Appreciate your help and Happy New Year.

Sorry about that.

Regards,

MP
If there is problem then don't think as problem, think as opportunity.
Steven Schweda
Honored Contributor
Solution

Re: Using usermod from doing ssh from master server

> Any idea.

Some of each? The shell on the local system
will eat one set of quotation marks, but you
really need them on the remote system.
Perhaps something more like this?:

ssh roxyio "usermod -c 'Rodnry S. Bryant,134234,,' pdstest"
Mike_305
Super Advisor

Re: Using usermod from doing ssh from master server

Hello Steven,

Thanks for the reply, the tip you gave me it worked but the user was in use so I still land up doing manually on few servers.

But it did help me out.

Thanks for all your help.

Regards,

MP
If there is problem then don't think as problem, think as opportunity.
Mike_305
Super Advisor

Re: Using usermod from doing ssh from master server

Thanks to all of you.
If there is problem then don't think as problem, think as opportunity.