build立公共密钥login后的SSH隧道问题

我正在尝试使用以下命令创buildSSH隧道

ssh -L 3307:127.0.0.1:3306 remoteserver 

以前,我没有设置公钥/私钥login(无密码login)。 然后使用这个命令会提示我input密码,然后坐在那里,在隧道打开时挂起。 现在,我已经设置了无密码login,这个命令实际上是将我login到远程服务器,并打开一个shell,当我只是想让它打开隧道。 请帮助!

man ssh

 -N Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only). 

所以,使用ssh -N -L 3307:127.0.0.1:3306 remoteserver

没有基于密码的loginshell是不正常的,你确定你没有改变别的东西吗?