james111 has asked for the wisdom of the Perl Monks concerning the following question:

Thanks a lot all you guys. I haven't tried with SSH yet but I going to install that module. We are not much concerned here with security here as the tool developed in perl is for internal use. But during it' execution we need to logon to remote solaris machine, and then there by login as Superuser or root user. Normal login using Telnet worked just fine but login as Superuser started giving problems.

Considered Fletch: Restore original content?
Unconsidered by GrandFather: No copy of original content to restore

  • Comment on Login to a remote solaris machine as superuser through perl

Replies are listed 'Best First'.
Re: Login to a remote solaris machine as superuser through perl
by zentara (Cardinal) on Apr 28, 2006 at 11:51 UTC
    Normal login using Telnet worked just fine but login as Superuser started giving problems.

    You didn't say whether you can telnet into the solaris machine as root. Many distributions have a setting to "disable root telnet logons" for security purposes. SSH is better.

    Even if you are not concerned with security, because it's "internal use", you may be giving away the solaris root password to anyone who looks at the various logs. It's not worth the risk.


    I'm not really a human, but I play one on earth. flash japh

      I agree ... it's better to create a user that's not named root, with permissions just to do the minimum functionality required ... and to use SSH

      That being said, recent versions of Solaris by default only allows root login from the console. Look in /etc/default/login for the CONSOLE setting.

Re: Login to a remote solaris machine as superuser through perl
by marto (Cardinal) on Apr 28, 2006 at 09:48 UTC
    Hi james2,

    I notice that this is your first post. Welcome to the Monastery.
    Without seeing your complete code it is difficult to give advice.
    However, in case you did not already know information sent via Net::Telnet is sent in plain text.
    You may want to take a look at Net::SSH.

    Hope this helps.

    Martin
Re: Login to a remote solaris machine as superuser through perl
by mantadin (Beadle) on Apr 28, 2006 at 10:19 UTC

    I would suggest to not supply a password at all.

    Rather, you could use keys (RSA or DSA keys for SSH protocol version 2). You can take a look to the ssh-keygen(1) manpage for details.

Re: Login to a remote solaris machine as superuser through perl
by cdarke (Prior) on Apr 28, 2006 at 10:04 UTC
    Many programs access the terminal driver at a relatively low level when reading passwords, they don't just read STDIN. This is to prevent automated hackers. I don't know if this is the case with your version of these tools, but if you use truss or strace on the all you will see what it is trying to do.
Re: Login to a remote solaris machine as superuser through perl
by jesuashok (Curate) on Apr 28, 2006 at 10:15 UTC
    Hi

    put is a subroutine which will send the input to login subroutine.
    when you execute a command using cmd subroutine this will just execute the command and send the result to assigned variable or whatever.
    so you have to use the login subroutine to do this stuff.
    Because these informations are clearly specified in
    Net::Telnet
    Also please have a look in the following link also
    Remote connect

    "Keep pouring your ideas"