Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-23-2011, 12:33 AM
|
#1
|
Member
Registered: Apr 2003
Location: india
Posts: 73
Rep:
|
SFTP jail Users Password updation
Hi to all,
I have configured the SFTP Jail for some of the users in my sftp server and which is hosted for my clients.
i have one small issues and i need the help from experts.
when i am resting the password it's updating in /etc/shadow file not in the /../jajil/etc/shadow file.
can you please help me how to update the password in /../jail/etc/shadow file instead of updating in /etc/shadow file.
|
|
|
03-23-2011, 04:11 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
A few ideas come to mind, in order of attractiveness (to me): - If your distro / version allows it, you could utilize the baked-in sftp server (+Match +ChrootDirectory) available in OpenSSH. Then, when you make sftp user password updates, they'll take system-wide.
- You could create a "change password" script that accepts/audits a user account argument, and then 1) runs it through passwd(1); 2) carefully backs up the jailed shadow(5) file, then copies the shadow(5) file from host to jail, preserving permissions.
- You could put the passwd(1) program and its libraries within the jail as well, and always change passwords in two places. (Ugh.)
|
|
|
03-24-2011, 12:20 AM
|
#3
|
Member
Registered: Apr 2003
Location: india
Posts: 73
Original Poster
Rep:
|
Thanks anomie for your reply,
ya i did the same only, i wrote the small script to place the password and account expire details in to /../jail/etc/shadow file.
unfortantely the script is copying the other or unwanted user details also, like root user details also in /../jail/etc/shadow file.
Now i have another question...
/../jail/etc/shadow file having root users details will create any issue...
|
|
|
03-24-2011, 04:05 PM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
Just curious - what sort of jail kit is this? And are you sure you can't use the OpenSSH approach I mentioned above?
As for copying shadow(5) entries, here's one way to grab only the lines you want:
Code:
# egrep '^user1:|^user2:|^user3:' /etc/passwd > /path/to/jail/etc/passwd
# egrep '^user1:|^user2:|^user3:' /etc/shadow > /path/to/jail/etc/shadow
(Be careful with that. Test it before using it on a production system.)
Last edited by anomie; 03-24-2011 at 04:06 PM.
|
|
|
All times are GMT -5. The time now is 12:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|