Linux中ssh与telnet服务启动方法

最近测试公司的项目接触到sco/SUSE/linux等操作系统,总是在telnet和ssh远程连接的时候出一些问题。总结如下;
 
配置SSH服务:
1.修改配置文件
    vi /etc/ssh/sshd_config
2.找到#PermitRootLogin no将其修改为PermitRootLogin yes(X删除,I插入)
3.SHIFT+:输入WQ退出
 
配置TELNET服务:
vi /etc/inetd.conf
将telnet stream tcp nowait NOLUID /etc/telnetd   telnetd行的#注释删除
 
以下是连接SUSE时遇到的一个异常以及解决方法:
 
Password authentication fails, I get "Authentication method password not supported by the server at this stage".
Many default SSH server installations are configured to refuse the authentication type "password". Often, they only accept "publickey" and "keyboard-interactive". You have different options:

Enable password authentication. E.g., in case of OpenSSH on Fedora, edit /etc/sshd/sshd_config and change the value of "PasswordAuthentication" to "yes", then send a HUP signal to the daemon so that it re-reads its configuration.
Switch to public-key authentication. Probably the best choice.
Try to use keyboard-interactive authentication. If you have a GUI that interacts with a user, then this is doable (check out the SwingShell.Java example).
In general it is a good idea to call either Connection.getRemainingAuthMethods() or Connection.isAuthMethodAvailable() before using a certain authentication method.

Please note that most servers let you in after one successful authentication step. However, in rare cases you may encounter servers that need several steps. I.e., if one of the Connection.authenticateWithXXX() methods returns false and Connection.isAuthenticationPartialSuccess() returns true, then further authentication is needed. For each step, to find out which authentication methods may proceed, you can use either the Connection.getRemainingAuthMethods() or the Connection.isAuthMethodAvailable() method. Again, please have a look into the SwingShell.java example.