LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-11-2011, 08:43 AM   #1
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Rep: Reputation: 31
rsync using www as user gives ssh error


we have a few webservers with a lot of sites. Apache is run as www as is all the files/folders. People are uploading via FTP, scp, so the problem is if I chmod so everyone can read, then rsync as a user it works until new files are added which then my ;
if rsync ..... fails with a permission denied.

Now... I can add a chmod in the script so everyone can read, but since www can already read, I figured I would just change my script to use www. I added the ssh key to his authorized_keys file, but when I try to just ssh in I see this in the secure file;


server sshd[29539]: User www not allowed because account is locked
sshd[29539]: Failed none for invalid user www from ip port 54983 ssh2


Now I read a few places already saying I need to add a password to the account, etc. but before I jump and try all I read, 1st major one, will this now break apache? Will this affect any startup things, etc. and .... will that unlock that user for ssh in or is there another preferred method?

Thanks.
 
Old 02-11-2011, 12:00 PM   #2
rafatmb
LQ Newbie
 
Registered: Feb 2011
Posts: 27

Rep: Reputation: 3
Check it on /etc/passwd what's the shell of the www user.

Generally, the shell of the www user is /bin/false or something like that. Then you must change to /bin/bash.


[]'s

Rafa
Linux, Linux and Linux! Suporte Linux
 
Old 02-11-2011, 12:23 PM   #3
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
Sorry, I should have posted that, but no it's correct;

www:x:501:501::/home/www:/bin/bash

As I said, due to that exact error, it seemed www doesn't have a PW, I'm just concerned if I create a PW, then restart the box, etc. will processes and such not start, etc.
 
Old 02-11-2011, 12:36 PM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
What's in /etc/shadow? When there in an exclamation mark in front of the password entry, then the account is locked.
 
Old 02-11-2011, 01:20 PM   #5
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
@Reuti, as you have guessed, yes there is.

www:!!:13601:0:99999:7:::

Now I will re-word the question. From the initial post/error and searching it seemed that www accounts was locked (confirmed as you said via the shadow file). The question (now re-worded a bit better) is can I unlock that user w/o having to create a password? I am using rsync + ssh and auth key's so want to go from server1 -> server2 as www, to copy the data over. I don't want to have to create a password which may affect other things, so can I simply unlock the account?

Thanks.
 
Old 02-11-2011, 01:24 PM   #6
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Yes, replace the !! with a * will enable it again. The login by ssh-key should work then, and there is no password set.
 
Old 02-11-2011, 03:08 PM   #7
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Original Poster
Rep: Reputation: 31
Thanks. Did that, but still not in ... closer, but I will need to look a little further.

/var/log/secure when I try shows;
User www from [ip] not allowed because not listed in AllowUsers

yet, /etc/ssh/sshd_config has;
AllowUsers admin www. I created/added the same ket to the authorized_key's file for the admin user, and when I try from the remote server I get;

Accepted publickey for admin from [ip] port 43240 ssh2 and I get right in. SSH was restarted after adding www to the allowuser list, so as I said, going to need to dig a little more.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync -e ssh error protocol incompatibility osio Linux - Networking 13 11-06-2019 05:35 PM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 10:48 AM
ERROR: Unknown user 'www' ! DiGiGoth Linux - Software 16 07-02-2009 08:58 AM
Rsync error cannot do ssh and transfer file linuxbee1 Linux - Newbie 13 06-23-2008 05:41 PM
Is there a way to allow a user to rsync files to my server without being able to SSH abefroman Linux - Security 1 12-08-2007 07:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration