My server has only an ipv6 address, and my computer can directly ssh
to it via this address. But when I tried to add the remote interpreter on this server in Pycharm, it tells me SFTP host is invalid
when it sees the ipv6 address.
How can I make it work? Thank you!
Update: adding brackets [2001:da8:...]
helped pass the host syntax check. But now upon clicking "Ok", Pycharm tells me "java.net.SocketException: Protocol family unavailable". How to pass this?
Finally I got that to work.
First, a valid IPV6 SFTP address must be wrapped in brackets. That is, instead of 2001:da8:201:1146:226:b9ff:....
, you should write [2001:da8:201:1146:226:b9ff:....]
.
Second, if you do so you will find Pycharm telling you "java.net.SocketException: Protocol family unavailable" and refuse to connect. This is an issue of Pycharm running under JDK 1.7 (yes, Pycharm is based on Java). To solve this:
-Djava.net.preferIPv4Addresses=true
but I'm not sure whether it matters.See here for more information:https://intellij-support.jetbrains.com/hc/en-us/articles/207241215-Network-connectivity-issues-when-running-under-Java-1-7