unable to initialise sftp on server - it's my .bashrc
Posted: 2022-10-20 15:54
I had a FileZilla SFTP connection to a Linux server to which I also had a terminal connection (using Tera Term), both of which were established with my personal ID (vs. a super-user, admin, etc).
Some time many minutes after establishing the connection, FZ suddenly disconnected and I wasn’t able to connect again. I could establish a FileZilla connection to our other Linux servers, and my terminal connection to the offending server persisted without issue.
Thinking about what was different I recalled having added few aliases to my .bashrc on that server shortly before the connection bombed. It turned out an error I made editing .bashrc was the culprit. I added an alias with the end quote misplaced:
I entered it like this - note that the quote is NOT at the end (the actual path I specified has been omitted for security reasons)
alias gohere="cd <a directory path>";pwd
It should have been:
alias gohere="cd <a directory path>;pwd"
Not sure why I could log on to the server directly with this in place but not make an SFTP connection, but as soon as I put the end quote in it’s correct location at the end of the alias the FZ connection worked.
Some time many minutes after establishing the connection, FZ suddenly disconnected and I wasn’t able to connect again. I could establish a FileZilla connection to our other Linux servers, and my terminal connection to the offending server persisted without issue.
Thinking about what was different I recalled having added few aliases to my .bashrc on that server shortly before the connection bombed. It turned out an error I made editing .bashrc was the culprit. I added an alias with the end quote misplaced:
I entered it like this - note that the quote is NOT at the end (the actual path I specified has been omitted for security reasons)
alias gohere="cd <a directory path>";pwd
It should have been:
alias gohere="cd <a directory path>;pwd"
Not sure why I could log on to the server directly with this in place but not make an SFTP connection, but as soon as I put the end quote in it’s correct location at the end of the alias the FZ connection worked.