Operating System - HP-UX
1753465 Members
4761 Online
108794 Solutions
New Discussion юеВ

Re: SFTP for multiple users

 
rmueller58
Valued Contributor

Re: SFTP for multiple users

Sorry hit the wrong key..

My idea would be to define the 1:18 to push the file, rather then have users come and get it. That way they can't come back and say "I can't get in, I am having problems" thing about the social engineering aspects a bit.

Is the "filename" going to be constant or variable?

I would check for the exist of the file to transfer 1st.

cd sourcefolder

for filename in `ls`
do
if [ -f "$filename" ]
then

DEFINE SCP process HERE:
for user in `cat USERFILE`
do
scp -b $filename $user@remoteserver:/home/$user/
done
else
exit
fi




make a list of the users in a column file

USERFILE
user1
user2
user3
...
user18



Robert Legatie
Advisor

Re: SFTP for multiple users

Sorry for the delay in response and thanks for all the responses. I cannot use ssh keys...so that option is off the table. I will call an expect script from the shell script to pass on the ID and password information. I hope this clears a few things. I do have the script for one user...i am trying to adapt it to fit 18 users. Awaiting for new responses.

Thanks in advance.
James R. Ferguson
Acclaimed Contributor

Re: SFTP for multiple users

Hi (again) Robert:

> I cannot use ssh keys...so that option is off the table.

Why is that? Secure Shell is a product that should be installed when a server is first installed. SFTP/SCP using public keys is simple to setup.

> I do have the script for one user...i am trying to adapt it to fit 18 users.

If each user runs the script under their unique login name, then either ${LOGNAME} or $(whoami) provides that name. The script could simply use that if it needs it.

Regards!

...JRF...
Fredrik.eriksson
Valued Contributor

Re: SFTP for multiple users

There aren't many ways that are more insecure then passing the password via a shell script (or expect script).

It's in clear text... Public keys are alot better for this particular thing. And I believe it's not a problem to just /bin/false (in /etc/passwd) the login shell and still be able to use sftp (should atleast work anyway) or scp.

It's just my 2 cents, and as JRF and some others said... still don't really get what you actually want to do.

I figured out so far that you wan't 18 users to be able to move files throu SFTP to a server which they all login with only a specific user?

Best regards
Fredrik Eriksson
Robert Legatie
Advisor

Re: SFTP for multiple users

I am closing it as it is too difficult to put all the environment constraints in here. Thanks to all those who replied.

James R. Ferguson
Acclaimed Contributor

Re: SFTP for multiple users

Hi Robert:

> I am closing it as it is too difficult to put all the environment constraints in here.

That's a shame...

> Thanks to all those who replied.

Please read:

http://forums13.itrc.hp.com/service/forums/helptips.do?#28

...it is a way of saying "thanks" and assigning value (of which there must be some, proportional to the quality of your question) to the answers you received...

...JRF...
OldSchool
Honored Contributor

Re: SFTP for multiple users

"I am closing it as it is too difficult to put all the environment constraints in here."


that's too bad. if you'd been able willing to describe accurately what the intended goal was, you'd have probably gotten several useful replies.

unfortunately, not being able to do so may also mean that the actual problem to be solved is "ill-defined". if so, trying to develop a solution may still be daunting