Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Doing an "emerge" over 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
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 6:14 pm    Post subject: Doing an "emerge" over ssh? Reply with quote

If I do an "emerge" to install something over ssh, and then dissconect my ssh session, can I reconnect using ssh and be able to see the progress of the emerge install?

Or is there a better way of remotely installing using emerge?
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri Oct 17, 2003 6:19 pm    Post subject: Reply with quote

No.

You can use
Code:
screen
or
Code:
nohup
.
Screen gives you an interactive screen session which can be detached from the terminal and later on be re-attached.
Nohup sends the output of a command to a log file and ignores SIGHUP. Therefore it will survive a ssh logout and keep on running...

Personally I prefer screen.
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 6:57 pm    Post subject: Reply with quote

At the end of the emerge of "Screen" I recieved this msg:
Quote:
* screen is not installed as setuid root, which effectively disables multi-user
* mode. To enable it, run:
*
* chmod u+s /usr/bin/screen
* chmod g-w /var/run/screen

Does this mean that if I want "root" access to the screen command I need to follow their directions of "chmod..."?
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri Oct 17, 2003 7:03 pm    Post subject: Reply with quote

No.

It means that you (if root or not) cannot simultanously hack into another user's screen session (and see and type what he/she sees or types).

+s permissions are not necessary to run screen as root.

BTW, I have the following ~/.screenrc
Code:
caption always
defscrollback 10000
startup_message off
#caption string "%Y-%m-%d %0c %3n %t (%W)"
caption string "%3n %t (%W)"
which makes screen even more usable :)
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 7:11 pm    Post subject: Reply with quote

AHHHH, "the light goes on :idea: " Great...Thanks! I will play around with "Screen" and see what I can break :lol: hehe.
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 7:25 pm    Post subject: Reply with quote

MY HECK!!! There is a "TON" of information to read through for "Screen". Can you give me a few pointers/command examples to get started?
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 7:31 pm    Post subject: Reply with quote

I found something to get me going...thanks again:
Quote:
SCREEN Command Quick Reference
Screen creates a virtual terminal in which you can perform actions. The unique thing about this virtual terminal is that
you can disconnect from it and then reconnect to it without disturbing what is happening within it. The cool thing
about screen is that it uses a buffer, so any output to the terminal that happened while you were detached will be visible
when you reattach.

The screen command is useful for executing processes remotely, which you don’t want to kill when you log out. i.e. If
I wanted to download a 650MB cdrom image to a school computer while I at home on my modem. I would log into
Lisa, use the screen command to launch ftp, start downloading the file, then detach from that screen and log out. Later
I can log back into Lisa and reattach to the screen to check on the ftp progress.

Launching and detaching
screen <command> Example: screen emacs Starts a new screen running Emacs
To detatch type Ctrl-A Ctrl-D Will take you back to the shell (Similar to an Emacs command)

Then to reattach
screen -r If you have multiple screens this command will list them.
screen -r 1234 Reattach to session 1234 as listed.
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri Oct 17, 2003 7:35 pm    Post subject: Reply with quote

All screen commands start with Ctrl-a (press the Ctrl-key and a lowercase a).


Here are some important commands (case-sensitive):
"Ctrl-a h" gives you a help screen.
"Ctrl-a c" creates a new screen window (it shows up in the bottom bar if you use my .screenrc). A fresh shell gets started in this window.
"Ctrl-a <SPACE>" cycles through the screen windows.
"Ctrl-a <NUMBER>" goes directly to the screen window with this number.
"Ctrl-a A" sets the shown title of the current screen window.

If you leave a shell the corresponding screen window goes away.
With the last screen window goes the screen itself.

To detach the screen (but keep the shells inside running), type "Ctrl-a d".
To re-attach screen, type
Code:
screen -r
.

For further information see the man page.
Good luck :)
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 7:51 pm    Post subject: Reply with quote

huh, some of the commands are not working. like "Ctrl-a h" I can't kill any of the windows either (instructions per the man file)...any ideas?
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri Oct 17, 2003 7:53 pm    Post subject: Reply with quote

Ooops: It's "Ctrl-a ?" :oops:
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Fri Oct 17, 2003 7:59 pm    Post subject: Reply with quote

OK, i'm starting to get the hang of things now :) thanks again!!!
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20588

PostPosted: Sat Oct 18, 2003 3:57 am    Post subject: Reply with quote

Moved from Installing Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Sun Oct 19, 2003 7:52 pm    Post subject: Reply with quote

MudPutty wrote:
At the end of the emerge of "Screen" I recieved this msg:
Quote:
* screen is not installed as setuid root, which effectively disables multi-user
* mode. To enable it, run:
*
* chmod u+s /usr/bin/screen
* chmod g-w /var/run/screen

Does this mean that if I want "root" access to the screen command I need to follow their directions of "chmod..."?


If you make it setuid root, you can do all sorts of wacky ACL stuff.

I once used it so a friend could watch me emerge stuff (I was demonstrating gentoo) in my root shell without being able to type anything. It was pretty cool.
Back to top
View user's profile Send private message
MudPutty
n00b
n00b


Joined: 06 Oct 2003
Posts: 42

PostPosted: Tue Oct 21, 2003 9:16 pm    Post subject: Reply with quote

Now that I have been using Screen for a little bit i'm hooked! I have been showing it off to everyone that isn't familure with it...Screen is a great tool to have!
Back to top
View user's profile Send private message
magic
Tux's lil' helper
Tux's lil' helper


Joined: 16 Apr 2002
Posts: 118
Location: Alameda, CA

PostPosted: Wed Oct 22, 2003 11:39 am    Post subject: Reply with quote

Thanks ... I've been looking for this for a long time!!
Back to top
View user's profile Send private message
triad
Apprentice
Apprentice


Joined: 10 Jul 2003
Posts: 234
Location: Dark Side of the Moon

PostPosted: Sun Nov 02, 2003 1:48 pm    Post subject: Reply with quote

Never new this program existed. Thanks all for the info. Screen Rocks :)
_________________
It's not the size of your processor that matters... But how you use it!
Back to top
View user's profile Send private message
chrisis
Tux's lil' helper
Tux's lil' helper


Joined: 22 May 2003
Posts: 112
Location: Auckland

PostPosted: Sat Apr 03, 2004 6:37 am    Post subject: Reply with quote

can screen be used as default shell? In otherwords can I create a user that when logged in /usr/bin/screen is the shell instead of /bin/bash?

I'm just a little unclear how to best use this. Do I, for eg:

1. ssh into my server, then start screen
2. Do stuff, then detach, then exit my ssh
3. Go somewhere else, ssh again, screen -r to get my screen session back?

Or does my /etc/password have to have shell set to screen instead of bash?
_________________
But the situation seemed to call for witty repartee. "Huh?" I said.
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Sat Apr 03, 2004 9:37 am    Post subject: Reply with quote

You could put screen into your .bashrc file, or whatever file gets automatically read when you log in.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
creche
n00b
n00b


Joined: 25 Apr 2003
Posts: 23
Location: Livorno, Italy

PostPosted: Sat Apr 03, 2004 10:15 am    Post subject: Re: Doing an "emerge" over ssh? Reply with quote

MudPutty wrote:
If I do an "emerge" to install something over ssh, and then dissconect my ssh session, can I reconnect using ssh and be able to see the progress of the emerge install?

Or is there a better way of remotely installing using emerge?


--nospinner

anyway use screen if u are making critical jobs.

Greets
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