-1
votes
1answer
45 views

Connect via SSH with hostname instead of username and hostname

Whenever I have to login to a remote server, I have to enter ssh username@hostname and subsequently a password. I want to save time by omitting some parameters whenever I try to login to a server. I ...
1
vote
1answer
40 views

Sourcing bashrc file fails with ssh -t

ssh -vvv -F /home/me/.ssh/config serva -t "source ~/.bashrc" This is the output I get when I use -vvv flag: debug1: Authentication succeeded (publickey). debug1: channel 0: new ...
2
votes
1answer
56 views

Including .bash_profile over ssh

I am trying to write a script that will: Copy files to a server (I already have a script copy.sh that does this task) ssh to that server cd to the directory where the files I just copied are run ...
1
vote
1answer
28 views

'script' session logging makes me exit twice

I'm using a solution described here to log my shell sessions, by adding this to the end of /etc/bash.bashrc: test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -f ...
5
votes
1answer
78 views

Linux: $SSH_CONNECTION is set even without SSHing to the server

I have a remote server and I am writing a script in the server and want it to fire only when I SSH. I thought of using the $SSH_CONNECTION and $SSH_TTY for this purpose. I found out that when I have ...
2
votes
3answers
532 views

SSH parameter to ignore .bashrc script

I have a server which when it starts, a line in .bashrc executes the following command /bin/watch ~/checker.bash which as expected watches that command upon server start. I also have a client which ...
5
votes
3answers
601 views

Run ssh login command without modifying remote .bashrc

We have a bunch of servers set up with set -o vi in their ~/.bashrc. It would be nice to be able to ssh into these boxes and automagically run set -o emacs as a timesave. I've seen a solution ...
8
votes
1answer
1k views

How to detect when a shell is owned by a remote SSH session?

My question is similar to this one, but I'm looking for something slightly different. I have a notebook PC that I use to access Linux machines on a network in two different scenarios: I have a ...