LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Auto ligin and command execution!!! (http://www.linuxquestions.org/questions/linux-newbie-8/auto-ligin-and-command-execution-4175454018/)

peacepanda 03-14-2013 04:09 AM

Auto ligin and command execution!!!
 
I have to always login into aix servers.What I want is to lgoin into to servers automatically i.e I dont want to always enter my credentials.I know this can be done using SSH but is there any other way to do this.Also I want to run some commands when I login.Can someone help me with examples or point me some documentaion on how this can be done.

Thanks,
Ajit

shivaa 03-14-2013 04:16 AM

First thing is that, though login without a password is possible (ofcourse using password less ssh), but without username it's not possible! (since you mentioned to login into server without entering credentials.)

Let's know how are you accessing your server - locally using GUI or remotely using ssh or similar protocol?

peacepanda 03-14-2013 04:28 AM

HI Shivaa,
I am accessing the remote servers using putty from my local machine using protocols like SSH and telnet.Agreed I do have to enter the username but once I enter the username I want the password to be entered automatically and couple of commands that should follow

Regards,
Ajit

shivaa 03-14-2013 04:45 AM

One option is password less login using ssh public keys, in which you will be able to login without entering a password and can invoke any commands on remote server, like:
Code:

~$ ssh -l username hostname.example.com "some_command"
OR
~$ ssh username@hostname.example.com "some_command"



All times are GMT -5. The time now is 01:23 PM.