How a user can connect to ec2 instance through WinSCP

-1

1

I created an EC2 instance with CentOS 7. I logged in from putty using the username 'centos'. Once I logged I can change user to root. I installed CWP and from the CWP I created a user account, Consider 'userme' with password 'xxxx'. When I run ls command inside /home I can see 'userme'. Now how can I login to userme from WinSCP to upload and download files. I tried logging in with .ppk file, but no use

Lenson Roy Saldanha

Posted 2017-09-16T09:47:06.023

Reputation: 3

Can you login with PuTTY using "userme"? – Martin Prikryl – 2017-09-16T10:33:09.837

It says Server refused key @MartinPrikryl – Lenson Roy Saldanha – 2017-09-16T11:13:39.607

So why do you limit your question to WinSCP, when you actually cannot connect with SSH at all? – Martin Prikryl – 2017-09-17T04:53:55.303

Because from PuTTY, If I loggin as centos, I can change user and goto any directory, but can't download and upload files, so I highlighted WinSCP – Lenson Roy Saldanha – 2017-09-17T10:56:53.537

Ok, but that's irrelevant to the root problem. – Martin Prikryl – 2017-09-17T14:51:13.617

I added the same question in StackOverFlow, Someone suggested me to add here and remove it from there, So I added here. Please help if possible – Lenson Roy Saldanha – 2017-09-18T05:08:26.357

Answers

0

My understanding is that "userme" has only a password and not yet a key associated with it.

  1. In the case you are trying to ssh (or WinSCP) using the password, you need to make sure you are allowing your users to authenticate with passwords.

    You need to to go to /etc/ssh/sshd_config and make sure "PasswordAuthentication yes" is set.

    Restart ssh service: service ssh restart

    This way you will be able to ssh with the password.

  2. In case you want to ssh using the key, you need to associate a key to "userme":

    Add your public key to "/home/userme/.ssh/authorized_keys"

And you should be good to go.

Algeriassic

Posted 2017-09-16T09:47:06.023

Reputation: 723

I wanted the second option, it worked like a charm, Thanks – Lenson Roy Saldanha – 2017-09-20T05:31:09.463