Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I often have to login on a remote server with a shared user. The servers do not have the same configuration. Especially regarding the shell used (some account use ...
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    4

    Automatize actions right after ssh login

    Hello,

    I often have to login on a remote server with a shared user. The servers do not have the same configuration. Especially regarding the shell used (some account use sh, other csh, or ksh or bash).

    I would like to use an unified configuration while using all these servers. So I use the following command to connect :
    Code:
    ssh $user_AT_$server -t exec bash
    And that works fine. I now have a bash shell when connecting on any server.

    Now, I would like to go a bit further and have an unified prompt.

    How can I emulate something like
    Code:
    export PS1=$string
    ?

    Obviously
    Code:
    ssh $user_AT_$server -t exec bash -c 'export PS1=something'
    won't work.

    Thanks.

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,301
    When you use -t exec bash, does that source .bashrc?
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  3. #3
    Just Joined!
    Join Date
    Jan 2012
    Posts
    4
    Hi,

    Yes, but I can't modify it.


    As I said there are many users on theses system. Some might already be using bash. I can't change that.

  4. #4
    Just Joined!
    Join Date
    Jan 2012
    Posts
    4
    That said, if I can make bash execute an alternative profile file, that would be awesome.

    Maybe I can do that with --rcfile?

    I'll try that.

  5. #5
    Just Joined!
    Join Date
    Jan 2012
    Posts
    4
    Yes it works.

    Problem solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...