Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Access the console from within X Windows and/or with ssh
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Gherald2
Guru
Guru


Joined: 02 Jul 2003
Posts: 326
Location: Madison, WI USA

PostPosted: Wed Jul 07, 2004 1:55 am    Post subject: Access the console from within X Windows and/or with ssh Reply with quote

Version 0.2

I trust you have heard of "screen". It is a wonderful porgram, but it can be tedious to remember to start it every time you log in.

Furthermore, using reconnect commands like "screen -ls" and "screen -dr" quickly becomes redundant.

This is a tip to make cloning your Alt+F# virtual terminal/consoles easy!

First, make certain you have screen installed properly:

Code:
emerge screen -a
chmod u+s /usr/bin/screen       #set uid root
chmod go-w /var/run/screen


Then, append the following lines to /etc/profile:

Code:
alias vc1="screen -x vc-1"
alias vc2="screen -x vc-2"
alias vc3="screen -x vc-3"
alias vc4="screen -x vc-4"
alias vc5="screen -x vc-5"
alias vc6="screen -x vc-6"

#automatically start screen if we are a virtual console
if [ `tty | grep vc` ]; then screen; logout; fi

#any commands such as "fortune" that print messages after login should be placed here, after screen.


Now whenever you:

1) ssh to your box and want to access a console program you left running

or 2) are in X and don't want to Ctrl+Alt+F# out of it

...simply run "vc#" and whallaaaa... how cool is that?


Last edited by Gherald2 on Thu Jul 08, 2004 10:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Milez
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2002
Posts: 116
Location: Atlanta, GA

PostPosted: Wed Jul 07, 2004 2:10 am    Post subject: Reply with quote

Dude, I love this trick. Nice combination. Don't you just love how unix allows you to be creative in setting up your system?
_________________
-=Miles Stoudenmire=-

Adopt a post initiative
Back to top
View user's profile Send private message
Gherald2
Guru
Guru


Joined: 02 Jul 2003
Posts: 326
Location: Madison, WI USA

PostPosted: Thu Jul 08, 2004 10:16 pm    Post subject: Reply with quote

Yep!

Tip updated to v0.2 on July 8, 2004:

- added logout invocation so screen behaves like a regular login session
- explained where commands should go that print text after login
- other minor edits
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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