LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Running a program on SSH login (https://www.linuxquestions.org/questions/linux-general-1/running-a-program-on-ssh-login-679059/)

beskone 10-25-2008 07:30 PM

Running a program on SSH login
 
Hi folks, this is my first post here on linuxquestions.org, i hope you can help me on this one.

i have sshd on my pc and i want to be able to connect via ssh anywhere, so far everything good. but i also want that when i logon on SSH that a program that i made run automatically.

thanks in advace.

unihiekka 10-26-2008 12:01 PM

You could add the script to your (bash) profile, probably in your /etc directory. Another way is to use an expect script. There are other ways, but these two are probably the easiest.

Two tips: 1) search LQ for similar questions, as this has been asked before. 2) google your question, because this is fairly basic stuff for ssh.

david1941 10-26-2008 12:05 PM

From man ssh:

~/.ssh/rc
Commands in this file are executed by ssh when the user logs in, just
before the user’s shell (or command) is started. See the sshd(8) manual
page for more information.

Dave


All times are GMT -5. The time now is 06:09 PM.