View previous topic :: View next topic |
Author |
Message |
qnx l33t
Joined: 25 Jun 2002 Posts: 638 Location: Göteborg, Sweden
|
Posted: Sun Dec 08, 2002 5:01 pm Post subject: Connect to screen from SSH |
|
|
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 |
|
|
Tuna Guru
Joined: 19 Jul 2002 Posts: 485 Location: Berlin
|
Posted: Sun Dec 08, 2002 7:35 pm Post subject: |
|
|
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 |
|
|
qnx l33t
Joined: 25 Jun 2002 Posts: 638 Location: Göteborg, Sweden
|
Posted: Mon Dec 09, 2002 8:14 am Post subject: |
|
|
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 |
|
|
Curious Bodhisattva
Joined: 13 May 2002 Posts: 395 Location: Sydney, Australia
|
Posted: Mon Dec 09, 2002 10:01 am Post subject: |
|
|
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 |
|
|
Curious Bodhisattva
Joined: 13 May 2002 Posts: 395 Location: Sydney, Australia
|
Posted: Mon Dec 09, 2002 10:10 am Post subject: |
|
|
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.
-- Curious _________________ Are you down with the Hawk? |
|
Back to top |
|
|
qnx l33t
Joined: 25 Jun 2002 Posts: 638 Location: Göteborg, Sweden
|
Posted: Mon Dec 09, 2002 7:10 pm Post subject: |
|
|
Curious wrote: | The following worked.
Works fine! I have a lot of time for people with Agent Mulder as their avatar.
-- Curious |
Haha! 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 |
|
|
qnx l33t
Joined: 25 Jun 2002 Posts: 638 Location: Göteborg, Sweden
|
Posted: Mon Dec 09, 2002 7:33 pm Post subject: |
|
|
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 |
|
|
lowbatt Tux's lil' helper
Joined: 13 Jul 2002 Posts: 83
|
Posted: Mon Dec 09, 2002 7:55 pm Post subject: |
|
|
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 |
|
|
|