Can't set password for newly added linux user [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I used this cmd to add a new user and a new group.
# groupadd lfs
# useradd -s /bin/bash -g lfs -m -k /dev/null lfs
# su lfs
$ passwd
Changing password for lfs.
(current) UNIX password:
Then no matter what password I typed (my root passwd, or a completely new one), they all failed.
$ passwd
Changing password for lfs.
(current) UNIX password:
passwd: Authentication token manipulation error
passwd: password unchanged
What's wrong with my setting ? How can I set the passwd successfully ? Thanks !

Become root and then change the password. It won't ask for current password.
su
passwd lfs

Related

Could not chdir to home directory after create a user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I've created a user in Ubuntu 16.04 using the commands
sudo useradd peris
sudo passwd peris
Then I log off, ans log in with the new user but I got this error:
Could not chdir to home directory /home/peris: No such file or directory
To automatically create the user's home directory you have to call:
sudo useradd -m peris
From now on, the best you can do is manually create the user's home directory using:
sudo mkdir /home/peris
And set the user's home directory so the system actually knows where to go. This can be done using:
sudo usermod -d /home/peris peris
Also, you want to make sure the said user has rights on his own folder. Use:
sudo chown peris:peris /home/peris

ssh: User not allowed shell does not exist [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Apache
CentosOS 5
Plesk 10
New on commandline and ssh.
While trying to get several users (root git friend) to ssh to the same shell and configuring passwordless connection I must have made a mistake.
I can no longer login over ssh as root or git but can as friend whose shell I transferred by editting etc/passwd.
I luckily can still login on plesk so gui file editing is possible.
here's what I found in my sshd errorlog
sshd[11999]: User git not allowed because shell /bin/bash\r does not exist
sshd[12000]: input_userauth_request: invalid user git
sshd[11999]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.xxx.xxx.dynamic.upc.nl user=git
sshd[11999]: Failed password for invalid user git from xxx.xxx.xxx port 54851 ssh2
I read something about sudo ing and incidently entering: causing the \r
But where to restore?
Here are some configurations
etc/ssh/sshd_config :
PubkeyAuthentication yes
ect/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/false
/usr/local/psa/bin/chrootsh
/bin/rbash
etc/passwd
git:x:10009:10009::/home/git:/bin/bash
friend:x:10010:10010::/home/git:/bin/bash
earlier I tried to install password less connecting
so there is a .ssh/id_rsa file somewhere on the server and on my local machine.
After reading Git's famous "ERROR: Permission to .git denied to user"
I tried
ssh-add -l
Could not open a connection to your authentication agent
My problem resembles this:
https://serverfault.com/questions/480806/ssh-root-access-denied-after-changing-shell
If I am logged over ssh as friend I cannot sudo to root:
sudo root
friend is not in the sudoers file
nor can I chsh
[friend#vpsXXX ~]$ chsh -s /bin/bash root
chsh: Running UID doesn't match UID of user we're altering, shell change denied
Hope someone can clear this up for me.
Happy to supply more info if needed
/bin/bash\r
means that you've edited the /etc/passwd or /etc/shells with a Windows editor as it contains Windows line feeds \r\n. Linux interprets only the \n and assumes that the remaining \r is part of the binary name.
Solution: Open the files in a Linux editor and remove the new line and add it again.
Also you could install the package tofrodos and execute:
fromdos /etc/passwd
fromdos /etc/shells

Trying to change a Linux password without using passwd [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm a linux noob and I'm stuck on a small detail of a class assignment.
I meant to do this from a root shell:
useradd myname -g sudo -p 'openssl passwd -crypt abc123'
To create a sudoer account for me.
Messed it up the first time, so now it says the user already exists.
I want to make sure I'm in the sudoers group and that I know my password to SSH in.
The passwd command can't be used, nor the adduser command.
I know the useradd command is available, but not sure if I can use that somehow...
Ideas?
Edit: And how could I double-check that it worked?
Edit2: I don't have access to an editor like nano or vim :/
Why not just examine (or edit, given the required powers) the /etc/passwd, /etc/shadow, /etc/group and /etc/sudoers files?
Just about everything to do with standard security can be found there
To double check if it works, simply log in from another terminal and try.
Found a work-around:
userdel myname
useradd -m -g sudo -p `openssl passwd -1 abc123` myname
For some reason, I'm able to use sudo but am not in /etc/sudoers
#paxdiablo, thank you for the help!

Creating an user without a password [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to create user without password like this:
sudo adduser \
--system \
--shell /bin/bash \
--gecos ‘User for managing of git version control’ \
--group \
--disabled-password \
--home /home/git \
git
It's created fine. But when I try to login under the git user I'm getting the password entering:
su git
Password:...
When I leave it empty I get an error:
su: Authentication failed
What's wrong?
"Disabled-password" doesn't disable authentication; it allows for non-password means of authenticating. Your "su" command isn't using any of those, so it prompts for a password. There won't be any that match the hashed string.
As a privileged user, you can delete the hashed password string and enable logins without any authentication (bad idea for this account). Better is to either set up sudo or ssh to allow a specific list of users to assume this identity.

How do I add a user in Ubuntu? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Specifically, what commands do I run from the terminal?
Without a home directory
sudo useradd myuser
With home directory
sudo useradd -m myuser
Then set the password
sudo passwd myuser
Then set the shell
sudo usermod -s /bin/bash myuser
Here's the command I almost always use (adding user kevin):
useradd -d /home/kevin -s /bin/bash -m kevin
There's basicly 2 commands to do this...
useradd
adduser (which is a frendlier front end to useradd)
You have to run them has root.
Just read their manuals to find out how to use them.

Resources