cPanel Unable to get user id for user - cpanel

I have three server, we will call them Ebonroc, Anzu and Onyx.
All Three are running the same version of Redhat and the same version of cPanel/WHM.
Onyx is a remote server and the other two are local.
When I try and copy and account using the WHM "Copy an Account From Another Server" tool from Onyx to Ebonroc it fails with only this error. (Unable to get user id for user $Username at /usr/local/cpanel/scripts/pkgacct line 155. Command failed with exit status 255).
If I copy the same account from Onyx to Anzu it will work, and it will also work if i then copy the same account from Anzu to Ebonroc after it has been transferred to Anzu but it will never work from Onyx to Ebonroc.
Both Ebonroc and Anzu are behind the same firewall and i do not see anything being blocked during either servers attempts.
Does anyone have an idea why I can’t transfer between Onyx and Ebonroc?

You should double check that the account name (cPanel username) is exist in the server Onyx.
try grep user_name /etc/trueuserdomains
And see that that account exists. If you sure that the account user_name is exists, then try taking the backup of the account manually
/scripts/pkgacct user_name
If you are still getting error as mentioned above, then check /etc/passwd file
grep user_name /etc/passwd
You should see a line starting like as below
user_name:x:uuu:ggg::/home/user_name:/bin/bash
Instead of /bin/bash you may see /usr/local/cpanel/bin/noshell if you haven't enabled the shell access for the account
uuu >> userID
ggg >> groupID
If you are not getting any o/p for the "grep user_name /etc/passwd", Then the account isn't created correctly.
If the account doesn't created correctly, cPanel can't detect the corresponding details.
Let us know with your results.

Related

Testing if user created in AD can be logged into on a VM

I am a QA automation engineer and in the web app I test there's a feature that creates Active Directory users.
My tools are - Selenium (Java), RemoteWebDriver, Selenium Grid (Docker)
I was trying to find ways to validate this process and came to a stop - this field (AD) is new
to me and I need to find a way to make sure the user was created and can be logged into in the
network.
I was trying to find a way to do this and came up with 2 options, where the first one is the least
preferred way:
Make a request (API? 3rd side tool?) to get the relevant user(s).
The issue:
A user created and registered in the AD doesn't necessarily mean that the client can log into it (at least by the way I understood how AD works), and so it loses the most important consequence of the feature.
Use a VM, get the AD user information (username + password: possible) and try to log into the VM using those details.
The issue:
I haven't came across a tool that does it, the closest thing is Robot class or WinAppDriver.
WinAppDriver seems like the best solution as of now although I don't know how to make the login process work since it's the process starts before the desktop is open and I don't know how to locate the username and password field, so I figured using Robot class seems like the simplest solution, if it works on a VM that is, which as of now doesn't seem like it does.
So, before advancing on learning how to use WinAppDriver with my current automation, I'd like and appreciate your opinions about the matter or if you have simpler solutions.
Thank you very much for reading!
• We can check whether a user is created successfully or not and if that user can log in to the AD domain or not by executing a script as below. It is a powershell script that auto logs in through remote desktop protocol in the other domain joined VM from an Azure domain joined VM that checks whether the recently created user can login or not.
Powershell script : -
cmdkey /list | ForEach-Object{if($_ -like "*target=TERMSRV/*"){cmdkey /del:($_ -replace " ","" -replace "Target:","")}}
echo "Connecting to 192.168.1.100"
$Server="192.168.1.100"
$User="Administrator"
$Password="AdminPassword"
cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
mstsc /v:$Server
• In the above script, replace the ‘$user’ value by the user principal name of the newly created user, i.e., ‘$User=”testdemo#example.com”’ and the ‘$Password’ value by the password set for that user. Also, ensure that you replace and enter the correct IP address of the domain controller/AD server. Also, ensure that before executing the above powershell script, execute the below commands in an elevated (administrator privileges) powershell console.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Lastly, please ensure that while creating the user, the option ‘User must change password at next logon’, ‘Account is Disabled’, ‘Password never expires’ and ‘User cannot change password’ are unchecked and not selected.
• Also, you can use the below command line script for logging in to the domain joined Azure VM through RDP protocol. In the below command, replace the ‘username’ and ‘password’ with the username and password of the user created recently to log in to the Azure VM with this command line script. Also, replace the ‘TERMSRC’ with the hostname of the server system or the domain joined VM where the specified UNC path is located and replace the ‘some_unc_path’ with the actual path UNC path of the shared directory folder. Please execute the below command through elevated (administrator privileges) command prompt.
Command script: -
c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nolog -command cmdkey /generic:TERMSRC/some_unc_path /user:username /pass:pa$$word; mstsc /v:some_unc_path

How to connect snowsql from PC (Windows 10)

I have signed up for 30 day trial version for snowflake, as part of learning I am trying to run the Snowsql (client) from my windows desktop. I installed client from snowflake client repository (account name, username and password are all correct).
Got the following error:
C:\Users\ugain>snowsql -a vg49826 -u ugainedi
Password:
**250001 (08001): Failed to connect to DB. Verify the account name is correct: vg49826.snowflakecomputing.com:443. HTTP 403: Forbidden
If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help.
Goodbye!**
Appreciate the help. Thank you!
Go to your account using the Snowflake web UI and look at the URL. Since there is no account vg49826.snowflakecomputing.com, that means you're running Snowflake somewhere other than on AWS_US_WEST_2. That's the only region that does not include the region in the account name for connection purposes.
Copy the portion of the URL up to but not including "snowflakecomputing.com". It will be something like vg49826.us-east-1, vg49826.east-us-2.azure, or something similar. Your Snowflake account, for the purposes of connecting to SnowSQL is the portion of the URL after https:// and before snowflakecomputing.com in the web UI URL.

sqlplus ORA-01017: invalid username/password; logon denied

on my windows 10 system every time I attempt to login I see the following error.
ORA-01017: invalid username/password; logon denied
During the install process I was not asked to create any users. I do seem to recall that I was asked to enter 'Oracle_1' as the admin password but I was not asked to enter an admin userid. I could not login with that id.
I was able to start a sqlplus session by executing "sqlplus /nolog". However, once in the session I really could not do anything, even a help command failed because I was not connected to a database.
On windows 10 how do I create a user that will enable me to successfully login and manipulate database tables ?
In Eclipse on a Tomcat server, the config file is under Overview>Open Launch Configuration> Arguments Tab> VM arguments. Make sure the keys for -Ddb.user and -Ddb.password are correct. Also check the information in c:\users\\config\customProperties\startup\application.properties. Perhaps someone more experienced may chime in based on your current set-up.

Cygwin: ssh-host-config fails with 'local group does not exist'

I am trying to install Hbase on a VM under Windows 7.
I followed the instructions and everything is OK until i do the ssh-host-config.
I see the following:
>Should privilege separation be used? Yes
>new local account ‘sshd’? Yes
>Do you want to install sshd as a service? Yes
>Enter the value of CYGWIN for the daemon?[] just <enter>
>Do you want to use a different name? No
>create new privileged user account ‘cyg_server’ account? Yes
>Please enter the password:
>Reenter:
>User has been created
>System error 1376 has occurred
>The specified local group does not exist.
>Adding user cyg_server to local group root failed
>Please add cyg_server to local group before
You can check what that lame error means, with:
$ NET HELPMSG 1376
The specified local group does not exist.
The problem seem to be that the script is not giving the new user account "Administrator" group membership. You can check this with: net user cyg_server from a normal windows command shell (CMD). Make sure the line reads:
Local Group Memberships *Administrators *Users
If it doesn't, you need to open the Windows control panel and navigate to User Accounts.
There you will find a new account called "Privileged server", which is the cyg_server account. You need to change the account type of that from Standard to Administrator.
Now restart sshd and check that it's running with:
$ cygrunsrv.exe --query sshd
Service : sshd
Display name : CYGWIN sshd
Current State : Running
Controls Accepted : Stop
Command : /usr/sbin/sshd -D
However, this is probably not the end of the story as these accounts cannot be used to login with, if they do not have a password assigned. You need to create (and add to /etc/passwd) a new account with remote login rights. And don't forget to check account password expiration...

DB Access denied

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'#'localhost' (using password: YES) in C:\wamp\www\connect.php on line 6
I've looked for a solution but haven't been able to find one.
The part on line 6 is
mysql_connect($server,$username,$password)
If it has to do with the problem, I'm using WampServer 2.1
Users admin#% and admin#localhost can have different passwords in MySQL. Try without a password.
Check the contents of the mysql.user table to see if your have multiple user records for admin.
This is a nice access model which allows different access depending on server the user is connecting from.
username/password combination should be incorrect.
You must have been prompted to set the password while installing WAMP Server.
You sure you are using the same password?
You can reset the root password by executing the following statement int the command line:-
mysqladmin -u root password NEWPASSWORD
If it complains mysqladmin is not a recognized command, then navigate to <WAMP-FOLDER>/mysql/bin folder before executing that statement.