How Do I Edit Passwd And Shadow To Encrypt The Password Of An User ?

Hi,

Right now on my system i have 5/6 users in my /etc/passwd file but all of them are in clear.
I know that normally encrypted passwords are in /etc/shadow and i know that the commands cryptpw and mkpasswd can be used to encrypt a string of character.

If for example an user is like this in passwd :

banana:lasagna:3:0:food:/:/bin/sh

Do i have to edit manually the shadow file with the encrypted string corresponding to "lasagna" here ? And what must i write in this shadow file ?

Thank you for the future answers !


Similar Content



Slackware 14.0 - End User Changing Password Failed

Hi all,

I am slackware 14.0 user. Recently I face one problem. As a root i can change one of my normal user's (assuming Peter) password. However, when I login as Peter, and try to change the password, the system does not allow me to renew my password.


root@slackwa /etc# ls -la | grep shadow
-rw-r----- 1 root shadow 9 Nov 29 2013 gshadow
-rw------- 1 root root 0 Jun 20 2013 gshadow-
-rw-r----- 1 root shadow 2272 Apr 12 22:44 shadow
-rw------- 1 root root 2274 Apr 12 21:40 shadow-
root@slackwa /etc# ls -la | grep passwd
-rw-r--r-- 1 root root 2362 Apr 12 12:58 passwd
-rw------- 1 root root 2306 Jan 8 17:38 passwd-
-rw-r--r-- 1 root root 2305 Aug 11 2014 passwd~


peter@slackwa ~$ which passwd
/usr/bin/passwd
peter@slackwa ~$ ls -la /usr/bin/passwd
-rws--x--x 1 root root 68725 Sep 14 2012 /usr/bin/passwd*

peter@slackwa ~$ passwd
Changing password for peter
Old password:
Incorrect password for peter.
The password for peter is unchanged.

One thing I can assure is the password I input is correct. I have another slackware 14 running on Dell R410, but it does not has this problem.


Please kindly advice. Thank you.

Inherited Laptop Passwd

t is that the passwd I changed to will not log me in and I chaged the passwd twice to make sure that it was not a typing error.

I did manage to create an account that I am using but I cant update packages or do much with it.

I have read shadow pat to passwd file but I am not sure what I am supposed to do with the file.

I have a feeling its got to do with keys on his account but I dont know much about that to reset them.

Can anyone help me with that?

Recovering Users & Passwords

Greetings Linux Enthusiasts..

I have one interesting query here..

Consider a scenario in which all /etc/passwd , /etc/passwd- as well as /etc/shadow files deleted.
In such condition what is most sure way to recover all users & passwords..

I hope you guys have solution..

/etc/shadow Question

Looking at the /etc/shadow file, for some of the system services accounts there are "*" and for others "!!" in the password field.
Searching online I have only found that !=*, i.e. prevent use for log-in, but, if true, what is the actual difference? Why not use "*" on all of them? And why double exclamation point?

Script

user="john bob randy susan"
I extracted local user list as: cat /etc/passwd | cut -d ":" -f1

Now I need to write a script to find the difference in user between these two (users defined as above and local user). I tried many ways its not working. Any help

#!/bin/bash
users="john bob randy susan"
luser=`/bin/cat /etc/passwd | cut -d ":" -f1`
......
....


Thank you

Exim4 Configuration

hello , can any one know about passwd.client which is in /etc/exim4/passwd.client file. in this file there are two fields
email and password as plain text eamil as a plain text is ok but password as a plain text not okey .
I want to know how to encrypt that pasword or hide like ***** in pasword field ..does anybody can help me with this ...i am new to this

Vsftpd - How To Change A Virtual User Password?

Hi, I'm really a newbie when it comes to Linux, so please bear with me.

We have a working FTP using vsftpd with a pam.d database (by the looks of it).

I've found the list of users/password in the /etc/vsftpd/ folder called passwd, but they are all encrypted.

How can I change the password for a single user? I'm sorry I've been looking for over 3 hourw, still don't understand how to do this.

Thank you very much for whomever can help.

User Migration Issues

Hello, I'm sort of a novice Linux user and was running into an issue with user migration. I'm trying to migrate users and groups from a RHEL 5.11 install to a CentOS 6.6 install, both systems are 64 bit. Initially I tried to do an rsync of the passwd, shadow, group and gshadow files with no luck. When trying to login with an existing account on the new server I get access denied. I tried to change the password on the new server, but even then it doesn't seem to change the password and I still get access denied. I then tried to tar up the four above files and then extracted them on the new server, but the same issue existed. I also created a new account on the old server, copied all the necessary files over to the new server and still have the same issues. Any ideas what I may be doing wrong or what I can try next? This is getting frustrating!

Thanks!

Can't Access Samba Share

I have set up a SFTP which I can connect to, go to the right directory and read/write files to.

The full path is home/sftpuser/SFTP/Customer
The user "sftpuser" I am connecting with is in the group "ftpusers" which has read/write access.

That works fine.

Here is my sshd_config:
Code:
Match Group ftpusers ChrootDirectory /home/%u/
 ForceCommand internal-sftp
  AllowAgentForwarding no
  AllowTcpForwarding no
  X11Forwarding no

However, I made a samba share of the folder Customer, when I go to the IP adress on a Windows machine "\\10.0.0.1\" I can see the folder Customer, when entering it requests user/pass and afterwards gives an error: you have not the right permissions.

In Webmin:
Customer /home/sftpuser/SFTP/Customer Read/write to everyone

My smb.conf:
Code:
[global]
    syslog = 0
    log file = /var/log/samba/log.%m
    read raw = no
    write raw = no
    passdb backend = tdbsam
    workgroup = DOMAIN
    usershare allow guests = yes
    socket options = TCP_NODELAY
    pam password change = yes
    passwd program = /usr/bin/passwd %u
    unix password sync = yes
    obey pam restrictions = yes
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    server role = standalone server
    server string = %h server (Samba, Ubuntu)
    max log size = 1000
    map to guest = bad user
    panic action = /usr/share/samba/panic-action %d
    dns proxy = no



[Customer]
    force create mode = 755
    browsable = yes
    public = yes
    path = /home/sftpuser/SFTP/Customer
    force directory mode = 755
    writeable = yes
    valid users = @ftpusers
    force group = ftpusers
    write list = @ftpusers

I have been struggling for 3 days and am totally out of ideas.

LS -L for the folder:
Code:
total 4
drwxrwx---+ 2 sftpuser ftpusers 4096 Apr  9 11:35 Customer

Nobody User Account Passwd Shows Expired

A few of my servers show that this user id has expired.

I know that this is the name of a user account and group account and if I check out /etc/passwd there is an entry under /sbin/nologin. And, if I check under say top -u nobody, I don't see anything running for that user account. However that is the extent of my knowledge on this user account.

Should I be concerned that the passwd for this account is expired or are there cron jobs/programs that rely on this account?

thanks