LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 10-25-2008, 08:30 PM   #1
beskone
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
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.
 
Old 10-26-2008, 01:01 PM   #2
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Rep: Reputation: 32
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.
 
Old 10-26-2008, 01:05 PM   #3
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh-ing into an already running program everyday Linux - Software 4 07-23-2008 05:08 AM
HELP!! running program to ssh bad_jaye Linux - Newbie 4 02-25-2008 08:23 PM
C program for automatic ssh login trollkotze Linux - General 5 01-09-2008 09:53 PM
Running Program Through SSH windisch Linux - General 6 10-04-2005 07:10 AM
Running a program in the background - SSH ziggo0 Linux - Newbie 4 03-05-2005 02:30 PM


All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration