Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You cannot pass username and password like this in a script. You have to use some communication tool like expect which is able to dialogue with interactive programs like telnet.
after seeing all suggations. I come to know that why not to try ssh I configured ssh on my swithc which details are.
SSH Configuration
Version ................... 1.5
Server Enabled ............ TRUE
Port ...................... 22
Host Key ID ............... 0
Host Key Bits ............. 1024
Server Key ID ............. 1
Server Key Bits ........... 768
Server Key Expiry(hours).. 1
Login Timeout(secs) ....... 60
Authentication Available .. Password,RSA
Ciphers Available ......... DES
Services Available ........ Shell,Cmd
but when I ssh from my system I do get the following error.
Selected cipher type <unknown> not supported by server.
Selected cipher type <unknown> not supported by server.
This is related to the cryptography used by ssh. The chiper you've selected in the configuration is DES, which is obsolete and highly discouraged because of its weakness. You can try to specify another chiper like 3DES and try to connect using the -c option of ssh. For example:
Yes. It is a security hole in the sense that the cryptography used by ssh can be stronger than that. Anyway better than the telnet solution which sends traffic in clear text. And if your switch configuration supports only DES you have no other chance to access it.
I want to be logged in through a script what key I need to copy to the switch and what will be the command for it. means I don't want to give passwords all the time for switch. then I think I am done.
You have to generate a private/public key pair using ssh-keygen, then you have to copy the public key (e.g. id_dsa.pub) to the file ~/.ssh/authorized_keys on the switch.
Code:
scp -c des name_of_key.pub user@IP:.ssh/authorized_keys
be sure that permissions of directory .ssh are set to 700 (that is drwx------) and permissions of the private key on the local machine are set to 600 (-rw-------) otherwise ssh will refuse to connect using public key authentication.
Maybe when connecting to the switch you have to specify the name of the key, if it is not the default name. In this case you have to use the -i option:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.