WinSCP connect to Ubuntu. Access Denied
Asked Answered
R

3

10

I installed Ubuntu13_desktop in VMware(VMware® Workstation 7.1.6) based with Windows 7. Now I want to connect to Ubuntu from Windows 7. Set the WMware as Host-only. Installed WinSCP in Windows, configured

protocol: SFTP;
Host name: ubuntu;
Port: 22;
UserName: oracle;
Password: ***.

Clicked Login, it showed

Searching for host...
Connection to host...
Authenticating...
Using username "oracle"
Authenticating with pre-entered password.
Access denied.
Access denied.

I can succeed to ping Ubuntu by cmd.

Can anyone help me to let me access Ubuntu by WinSCP? Thanks in advance.

Redpencil answered 7/1, 2014 at 5:20 Comment(9)
This is off-topic for stackoverflow. It belongs on superuser instead.Carrillo
I'm sorry? Would you mind telling why it is off-topic?Redpencil
Yes, I'm trying connect to Ubuntu machine from windows machine.Redpencil
What did you do to setup the oracle account?Carbonous
@MartinPrikryl, I followed this post: srmklive.comRedpencil
Can you login with that account locally on the Ubuntu machine? Did you check SSH server log?Carbonous
@MartinPrikryl, yes, I can login with that account, and when I use WinSCP to connect Ubuntu, syslog in Ubuntu didn't change any more.Redpencil
There has to be some record of the login attempt somewhere.Carbonous
my experience with this problem is Leap 15.1 has no option for SSH.Champac
H
26

Well the port 22 is for SSH service. So you can probably try installing openssh-server in your ubuntu by typing

sudo apt-get install openssh-server

and then try connecting with the following details:

protocol: SSH

hostname: [IP Address of the computer]

port: 22

username: [username]

password: [password]

Hopefully this should work.

Hashum answered 7/1, 2014 at 14:24 Comment(3)
Hello, thanks for you advise. I did sudo apt-get install openssh-server. But it still doesn't make sense. Now, I installed FileZilla in Windows, it prompted Status: Connecting to 10.112.20.229... Response: fzSftp started Command: open "[email protected]" 22 Error: Network error: Connection refused Error: Could not connect to serverRedpencil
And the problem became more serious. By WinSCP, it prompts The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP? Prefer using encryption.Redpencil
For a reference, the above problem was asked here: The server rejected SFTP connection, but it listens for FTP connectionsCarbonous
L
2

First look at auth.log on the system.

cat /var/log/auth.log

In my case with WinSCP, I found something like this:

fatal: no matching mac found: client hmac-sha1,hmac-sha1-96,hmac-md5 server hmac-sha2-512,hmac-sha2-256,hmac-ripemd160 [preauth]

And comment the line in /etc/ssh/sshd_config:

MACs hmac-sha2-512,hmac-sha2-256,hmac-ripemd160

don't forget to restart ssh :-) Hope this can help some one.

Lorenlorena answered 5/8, 2015 at 0:21 Comment(1)
Thank you, this workaround worked for me, but it would be good if somebody can elaborte on the security implications of this,Duntson
K
0

If sshd (openssh-server) is installed and running, but still no access when using WinSCP. In Ubuntu 16.x look at the auth logs:

sudo cat /var/log/auth.log

I found this:

No supported authentication methods available [preauth]

The problem is Ubuntu sshd configuration defaults to public/private key authentication for remote ssh access:

RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no

If you want to skip the kay-pair work, Open the sshd conf file:

sudo nano /etc/ssh/sshd_config

Find the above attributes and modify to:

RSAAuthentication no
PubkeyAuthentication no
PasswordAuthentication yes

restart sshd:

sudo systemctl restart sshd

If you have set up a user on the Ubuntu 16.x instance, you now should be able to ssh or WinSCP with username/password. Please be aware that the security of the system is now at greater risk.

Kamal answered 11/1, 2018 at 22:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.