After setting ~/.bashrc the FileZilla doesn't work

橙三吉。 提交于 2019-12-23 06:08:45

问题


To auto add ssh key I edited the ~/.bashrc file and added eval "$(ssh-agent -s)" and ssh-add at the end. It works well.

After doing this, I cannot visit the server via SFTP with FileZilla.

How can I fix this with keep auto running ssh-add?

My server OS is CentOS 6.7. I also access the server via shell.


回答1:


The guy who answered your previous question¹ got something wrong: eval "$(ssh-agent -s)" should only be executed for login shells (e.g. when you are logging in over regular SSH to run commands on the server's command-line).

Other tools, like FileZilla, may log in with non-interactive shells and these tools don't need or want the SSH Agent to be running.

~/.bashrc applies to both types of shells, so it is not the right place to start ssh-agent. ~/.bash_profile is a better choice since it only applies to login shells. Move the ssh-agent command there and everything should work again.

¹I'm that guy. Sorry for steering you wrong! I'll update that answer too.



来源:https://stackoverflow.com/questions/34428134/after-setting-bashrc-the-filezilla-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!