4

I've tried different ways and read some solutions including these:
Why I am not able to ssh as root?
Editing with Winscp
And an article from Forum of Ubuntu

  1. I don't understand why when I connect with ubuntu via PuTTY, I can have root permission and modify files. However, when I connect with ubuntu via WinSCP, I'm another user (I used the same username and same private key(pem) on both connecting software) and can't modify files.

  2. Then I found some possible solutions from the links above. I tried to set root password and permitRootLogin. But then, when I log in with the root username, it says:

    Received too large(1349281121 B) SFTP packet. Max supported packet size is 1024000B. The error is typically casued by message printed from startup script(like .profile). The message may start with "Plea".

    Cannot initialize SFTP protocol. Is the host running a SFTP server?

    whereas when I changed the username back to ubuntu, then it works(but I can't modify files when I'm not root user).

I am very confused, please anybody if you can point me out, I'd be much appreciated.

0

2 Answers 2

5

I believe that the error message you are getting explains it.

Your server's root account has wrongly setup profile scripts. Some of them print a message that violates SFTP protocol. There's different profile script for a terminal and non-terminal session (one that has and does not have TTY allocated). Messages can be printed only from the script used for terminal sessions. When you print a message from profile script used for non-terminal sessions, it breaks any client using a strict protocol (such as SFTP or SCP).

The message starts with "Plea" as the error says. It can easily be something as trivial as

echo "Please be careful when using root account!"

You will see a complete message when you log in using an SSH terminal (such as PuTTY).

Typically you will need to move the commands that print the message from .bashrc script to .bash_profile.

It works with ubuntu account, because its profile scripts do not print the error message.

See also WinSCP documentation for the error message "Received too large (... B) SFTP packet. Max supported packet size is 102400 B".

1
  • 1
    In my case it was Please login as the user "admin" rather than the user "root" Sep 8, 2016 at 22:28
0

I encountered same issue and found in /etc/security/limits.conf the max login count of the user was exceeding and that was not allowing me to winscp.

You can either remove the extra users or increase the login limit for that user.

The login will be successful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .