I need to set up some handy dandy keyboard shortcuts as I am fed up with setting up various aliases each login time from scratch. what is the most convenient way to do this since I don't have the proper right to change the .profile file?

  • 2
    Can you provide more detail on how come you can't change .profile? It's very unusual to be unable to modify files in your own home directory. If you are working off some kind of read-only system than kind of by definition there's nowhere that you can save customizations. – Celada Dec 14 '14 at 19:09
  • It is a server that I can reach to that file with read only privileges. I'm using user credentials provided for everyone. Sth like test/test123. That is why I cannot change any settings permanently. – ybaylav Dec 15 '14 at 9:11
  • @ybaylav: Could you run $ ls -laht .profile .kshrc in your home directory and tell us what exactly the permissions are on your .profile and .kshrc? – unclejamil Dec 15 '14 at 12:50
  • @unclejamil there's no .kshrc file in the server. And there is nothing containing the permission keyword in .profile – ybaylav Dec 15 '14 at 12:57
  • @ybaylav: I'm a bit confused. What is a 'permission' keyword? And if .profile exists in your home directory then running $ ls -laht .profile will tell you the permissions associated with that file, no? – unclejamil Dec 15 '14 at 13:05

Since it looks like you don't have the ability to customize your .profile but you can write to /tmp then you could do the following:

  • Put all your customizations into a shell script (e.g. $HOME/myCustomizations.sh) on your local server. Something like this:

     alias ls='ls -laht'
  • scp $HOME/myCustomizations.sh to the /tmp directory of your remote server:

     $ scp $HOME/myCustomizations.sh user@remoteServer:/tmp/
  • ssh into your remote server as you would normally.

  • run your script there.

That should get your customizations into the ksh you are running in that terminal. Admittedly it's annoying to have to scp everything over every time you want to log in and then run that script but this is likely an improvement over what you are doing now by typing everything in at the prompt after logging in. In any case /tmp/myCustomizations.sh should live until someone reboots the remote server and cleans out the /tmp directory.

Give that a shot and let me know if it gets you anywhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.