LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-18-2012, 08:43 AM   #1
mah454
Member
 
Registered: Oct 2009
Location: Iran
Distribution: Debian , Ubuntu , RHEL , CentOS , NetBill
Posts: 134

Rep: Reputation: 15
Problem Screen and ssh


Hello
I ssh to server with this command :
Code:
[USERNAME$HostName:]$ ssh -t skynet -S RCS ssh username@server
Password : 
[USERNAME$HostName:]$ screen -ls 
There is a screen on:
        4792.RCS        (06/18/2012 06:05:22 PM)        (Attached)
1 Socket in /var/run/screen/S-username.
I need second client automatic get screen with ssh command :
for example this commands not work :
Code:
[USERNAME$HostName:]$ screen -x ssh username@server
There is no screen to be attached matching ssh.
Or this command :
[USERNAME$HostName:]$ ssh username@server screen -x
Password: 
Must be connected to a terminal.
How can fix this problem ?
 
Old 06-18-2012, 10:06 AM   #2
mah454
Member
 
Registered: Oct 2009
Location: Iran
Distribution: Debian , Ubuntu , RHEL , CentOS , NetBill
Posts: 134

Original Poster
Rep: Reputation: 15
find answer ... !
thank you
 
Old 06-18-2012, 02:09 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
I have a wrapper script for ssh that does this for me. It expands on the syntax for user@host. I can append +NAME to the user part, and it will automatically invoke screen and name the screen session to NAME (so using the same name again gets back to the same screen session). It also extends host to allow +PORT to be appended so I can force a port number from commands that won't allow a port (e.g. rsync). Then I modify the unfound command handler in bash to process any unfound command with @ in it as an ssh command. So I can log into screen session "foo" on my user on host "bar" by just typing "+foo@bar" at the command prompt.

http://phil.ipal.org/scripts/ssh

Last edited by Skaperen; 06-18-2012 at 02:13 PM.
 
  


Reply



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
[SOLVED] Weird SSH problem - blank screen / lockup ahmadj Slackware 1 08-24-2011 09:29 AM
[SOLVED] Remote access problem-no ssh;local console rapid scrolling screen no login prompt kapshure Linux - Newbie 2 11-08-2010 04:41 PM
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
SSH To screen? Renaxgade Linux - Networking 2 04-23-2004 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:28 AM.

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
Open Source Consulting | Domain Registration