Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Connect to screen from SSH
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Sun Dec 08, 2002 5:01 pm    Post subject: Connect to screen from SSH Reply with quote

I've been looking for some screen (the GNU app) info and how to use it with SSH clients, e.g. PuTTy, but couldn't find what I was looking for :( Maybe here I can get some help?
I would like to connect to an active console remotly, via SSH. So I run screen at vc1 at home. Inside screen I run some commands, e.g. emerge. Then I connect to my sshd from e.g. PuTTy and login as usual. When I'm in I can run "top" and see which processes are running. But how do I do now to connect to vc1 and see what's going on there with the emerge??
Kindest regards, Jacob W.
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
Tuna
Guru
Guru


Joined: 19 Jul 2002
Posts: 485
Location: Berlin

PostPosted: Sun Dec 08, 2002 7:35 pm    Post subject: Reply with quote

Code:
screen -ls
prints out currently running screens of that user. use
Code:
screen -r [jobnumber]
to catch them. was it that you rtied to do? i cant believe it is not mentioned in the man page..
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Dec 09, 2002 8:14 am    Post subject: Reply with quote

Wow! Thx very much!
So, I have to run my commands in screen...Hmm...Do I still need bash as default shell?? Can't I just set screen to it?? Or maybe screen isn't a shell, so I still have to use bash "under" screen?? Is there any way to autostart screen, so I always run my commands inside it??
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Mon Dec 09, 2002 10:01 am    Post subject: Reply with quote

Be careful not to create a loop where screen is in turn executing screen each time it creates a new 'pane'. You might find some informational reading here.

-- Curious
_________________
Are you down with the Hawk?
Back to top
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Mon Dec 09, 2002 10:10 am    Post subject: Reply with quote

The following worked.

I created a user named screenie, made her a home directory, and set her password.

Then:
Code:
root@valkyr screenie # usermod -s /usr/bin/screen screenie
root@valkyr screenie # echo shell -/bin/bash >~screenie/.screenrc


Works fine! I have a lot of time for people with Agent Mulder as their avatar. :-P

-- Curious
_________________
Are you down with the Hawk?
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Dec 09, 2002 7:10 pm    Post subject: Reply with quote

Curious wrote:
The following worked.
Works fine! I have a lot of time for people with Agent Mulder as their avatar. :-P
-- Curious

Haha! :D Thx alot!
Anyway, very helpful information! Thanks!
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Dec 09, 2002 7:33 pm    Post subject: Reply with quote

I tried it out (on another user) and I don't think I'm going to use screen by default. No, don't get me wrong, Curious' idea worked very well, but it looks like screen has some disadvantages. E.g, I can not su to root (nor any other user), or I can't get gpm to work (in e.g links).
However, next time I would like to connect to a emerge from school, I think I know what to do:
Code:
1. Login as root
2. Start screen
3. Start emerge(s)
4. Login remotly (perhaps as root, but I'm not sure if I need to, it might work with other users to I guess)
5. Run screen -ls to list runing screen sessions
6. Run screen -r the_pid_of_session_I_want_to_connect
7. Play!

Correct me if I'm wrong!
Thanks for all help!
Kindest regards, Jacob W.
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
lowbatt
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2002
Posts: 83

PostPosted: Mon Dec 09, 2002 7:55 pm    Post subject: Reply with quote

Thats pretty much they way i use screen but i just loggin as a reg user then su to root start screen. run whatever command i want. Hit ctl-a then clt -d and that detaches the current screen and leaves it im limbo basicly.

I go to work and login as the regular user.. I just dont like to log directly into root remotely and the fact that I cant since i have that disabled. then i su to root and then type screen -r and it resumes the screen i had open. Plus you can always disconnect it again with the ctl a-d command.
_________________
Information is pure. Take a knife, for example. You can use it to cut up vegetables, butter your bread, etc. Or you can use it as a weapon. The way in which information exists in its many forms leaves for us the decision how to use it. - Maynard -TOOL
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum