Reply to topic

konsole tab names showing remote server name

halebi
Registered Member
Posts
1
Karma
0
Hi There,
I am using a gateway to log in to my remote machines. When I use Konsole the tab name only shows the gateway name not the real remote server name. This is a problem for me as I am using multiple tabs which belong to logins via the gateway to different servers. As in this case I can only see the gateway name on all the tabs I cannot distinguish between these based on the actual server name I am connected to. Also the tab does not show the username, not even on the gateway computer. An example with my current "Profile Settings" for "Remote Tabs" [i.e. (%u)@%H] is:

I am logged on to myserver.example through gateway.example.
The tab in this case named like:
()@gateway.example
instead the one I would like to see:
username@myserver.example

Is there a workaround to this? Can the konsole get the username and "real hostnames" from the remote machines?
Thanks,
Ebi
User avatar bcooksley
Administrator
Posts
18614
Karma
83
OS
Unfortunately Konsole has no way of seeing what you are doing via the gateway connection you have established - so it can't determine if any additional remote connections have been established i'm afraid.

I'm not sure why the %u operator would fail to operate properly even locally though - does the username contain unusual characters, or is it set via ~/.ssh/config or a similar system?


System Settings and Device Actions KCM maintainer
Image
sfitcs
Registered Member
Posts
7
Karma
0
halebi wrote:Hi There,
I am using a gateway to log in to my remote machines. When I use Konsole the tab name only shows the gateway name not the real remote server name. This is a problem for me as I am using multiple tabs which belong to logins via the gateway to different servers. As in this case I can only see the gateway name on all the tabs I cannot distinguish between these based on the actual server name I am connected to. Also the tab does not show the username, not even on the gateway computer. An example with my current "Profile Settings" for "Remote Tabs" [i.e. (%u)@%H] is:

I am logged on to myserver.example through gateway.example.
The tab in this case named like:
()@gateway.example
instead the one I would like to see:
username@myserver.example

Is there a workaround to this? Can the konsole get the username and "real hostnames" from the remote machines?
Thanks,
Ebi


Not an answer to your question - but possibly a solution to your problem.
I use the following command:-
Code: Select all
$ Remote=dev;konsole --new-tab --p Icon=network-server --p RemoteTabTitleFormat=$Remote -e ssh -t "$Remote" screen -dR

This opens an ssh session at "dev" in a new tab in the existing Konsole session with the Network Server Icon, and the name of the Remote machine (in this example, dev) in the tab.
You could write a script that gets the remote machine's name and put it in $Remote, then runs the above command. If you don't use ssh keys (and ssh-copy-id) you'll need to install sshpass to automate the part of the script that gets the remote machine's name. I tend to use bash_aliases:-
e.g. alias sshdev='konsole --profile dev&'
and kde profiles
e.g. ~/.kde/share/apps/konsole/dev.profile
Code: Select all
[Appearance]
ColorScheme=BlackOnLightYellow
Font=Oxygen Mono,12,-1,5,50,0,0,0,0,0
[General]
Command=ssh -t dev screen -dR
Directory=
Icon=network-server
LocalTabTitleFormat=%D : %n
MenuIndex=3
Name=Dev
Parent=FALLBACK/
RemoteTabTitleFormat=Dev : %u
ShowNewAndCloseTabButtons=false
ShowTerminalSizeHint=false
StartInCurrentSessionDir=false

(and ~/.ssh/config profiles for my remote connections.

It should be fairly simple to knock up a kdialog picklist that allows you to choose a remote host and will open a labelled ssh session in Konsole and hot-key it, or do something similar to me and create a Konsole profile for each one.

Kind regards

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Dimitrios, drnn1076, Exabot [Bot], Google [Bot], google01103, Hans, Horus, koriun, Majestic-12 [Bot], pbCyanide, pedrorodriguez, random_fan, scummos, SeaJey, Sogatori, Sogou [Bot], TheraHedwig, vascobasque, whatthefunk, Yahoo [Bot], yurchor, z-uo