In my learning track for Amazon EC2, I thought it would be a great idea to just always become the root user while still logging in. I added this line to my .bashrc
/usr/bin/sudo /bin/bash
That way, I would not have to SSH in as the root user, but I would be automatically switched when I log in. However, when this was in the .bashrc, it broke any SFTP client that tried to coect. The errors varied depending on the client used, but usually they all ended up with a timeout, even though they successfully coected to the remote host. WinSCP suggested that an SFTP server might not be ruing on the host.
I am now fully aware that adding that line was a bad move, but I don't know why this breaks SFTP. I'm logging in as ec2-user, but becoming root (I think), yet I can't understand why this causes a problem.
برچسب:
نویسنده: استخدام کار