LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Push my SSH to another pc (http://www.linuxquestions.org/questions/linux-software-2/push-my-ssh-to-another-pc-753548/)

ojha_riddhish 09-08-2009 08:16 AM

Push my SSH to another pc
 
Dear friends,
Sorry, for a noob question. But, I trust the capabilities of SSH server and I know that SSH supports forwarding my SSH to remote machine. I don't know how. What I want to do is:

My machine's IP is 192.168.1.36 with OpenSSH server and client installed. I have another machine with IP 192.168.1.33 which is usually installed for games with OpenSSH server and client installed. Both machines have Ubuntu Jaunty. My firewall is disabled. I can ssh to .36 machine from .33 and vice-versa. I want to know how can I send my machine's(.33) SSH to .36.

I mean, if I enter a command in .33 machine for SSH, it should send my SSH session to .36 machine and ask for authentication there. After entering valid credentials, the .36 machine should have my SSH session from .33 machine.

So, I can control my .33 machine and rectify errors if they occur. I hope, am understood perfectly. If anyone have done this, please reply with your configuration. I need to do it. Please help!

Thanks in advance!

Matz 09-08-2009 09:17 AM

Can't figure out your problem: what do you want to send from .33 to .36?

Can you provide an example?

vishesh 09-08-2009 09:33 AM

Dear ojha

You can set up sshd on both machine using private/public key authentication to avoid password prompt everytime to connect another linux machine. For steps to configure sshd on both machine , please link given in my signature.


Thanks

ojha_riddhish 09-08-2009 11:41 PM

Dear Matz & Vishesh,
Thanks for taking the time out and reading my post. Thanks!

I have two machines, one I use for my development(.36) in php, bash, etc. The other, I've setup as a game server(.33) which my nephew and niece play on. Both machines have jaunty running perfectly with openssh server and clients. I've even set public/private keys so I can login to any machine without needing the password. The kids doesn't know of it.
There are times when the games they play stop responding, or anything of the sort, a problematic situation. In those times, they run to my room asking for help. I have to manually ssh to that machine with X forwarded or use vnc to view and rectify the error.
Now, what I want is to write a script containing a single command of ssh. When this command is executed it provides the ssh session of the game server(.33) on my machine(.36). Then, my kids dont have to run in my room and call for help. They can just double click the script and sit back until I try to solve their issue. This thing will make the kids lazy, but its a good thing for me to learn more about ssh and ubuntu. I just need myself to be reminded of the situation on the game server.

Thanks in advance!

JulianTosh 09-09-2009 02:08 AM

Quote:

Originally Posted by ojha_riddhish (Post 3674260)
I can ssh to .36 machine from .33 and vice-versa.

This sounds like you're already doing what you're asking. You can ssh to and from each machine. So I (we) are confused...

Quote:

Originally Posted by ojha_riddhish (Post 3674260)
I mean, if I enter a command in .33 machine for SSH, it should send my SSH session to .36 machine and ask for authentication there. After entering valid credentials, the .36 machine should have my SSH session from .33 machine.

I picture this as sending the command as a parameter to the ssh command... such as:

Code:

ssh user@example.com "service sshd restart"
which would connect to the remote machine, ask for credentials and run the service command.

If you are asking about running GUI commands remotely, then do the same thing but use the -Y argument to forward X11. For instance,

Code:

ssh -Y user@example.com "system-config-network-gui" &
would launch the remote system's network gui app on your local display.

Did I even come close to what you're asking?

JulianTosh 09-09-2009 02:10 AM

wow, i let that unfinished post set a little too long. nevermind.

chrism01 09-09-2009 08:50 PM

Sounds like you want to set up a cmd on the games system that uses ssh public key auth to login to your desktop and use the 'wall' cmd to let you know they have a problem
http://linux.die.net/man/1/wall
Personally I think the exercise is good for them :)

ojha_riddhish 09-11-2009 07:21 AM

Dear Friends,
I am sorry that I am unable to explain it to you what I want and in return I am confusing you. I apologize for that.
I just wanted to see an SSH session on my pc from the remote machine as a popup whenever my kids execute the script. Consider as if they are allowing me to do anything on their pc.

Thanks in advance!

JulianTosh 09-11-2009 07:41 AM

Ah. Try playing around with this... On your kid's computer, type this in:

Code:

ssh dad@dadsComputer "DISPLAY=:0.0 /usr/bin/zenity --info --text 'help me, dad!'"
replace dadsComputer with the name/IP of your computer. You should get a popup that says "help me, dad!"

From there, you can play with sudo and ssh keys and a batch file so all they have to do is click a link and you'll get notified.


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