I'm using a soft called TeraTerm as my unix terminal. I encountered the following problem yesterday. I could not execute a script, altough a colleague could. We are both using the same soft, logging to the same server, using the same user. The difference was that I was using ssh, while she was using telnet.
1. If I login to server A with user X using telnet(port:23), the path contains the current directory (".") in it.
2. If I login to server A with user X using ssh(port:22), the path does not contain the current directory (".") in it, which was the problem.
What's the difference between using telnet and ssh ? Why is the path different, although I'm connecting to the same server with the same user ?
He said, he logs in as user X on the same machine, so it shouldn't be the user, nor the users shell setting.
man telnet wrote:
Telnet uses at least the HOME, SHELL, DISPLAY, and TERM environment variables. Other environment vari‐
ables may be propagated to the other side via the TELNET ENVIRON option.
man sshd wrote:LOGIN PROCESS
When a user successfully logs in, sshd does the following:
1. If the login is on a tty, and no command has been specified, prints last login time and...
9. Runs user's shell or command.
I don't see an obvious difference here, but which configfile is read or isn't may differ, and in the end the configfile might evaluate, if it is called from ssh or telnet.
You may put some
and so on in .bashrc, /etc/bash.bashrc and so on, to see, which one is invoked, or search, where "." is added to the path.
Stefan Wagner wrote:He said, he logs in as user X on the same machine, so it shouldn't be the user, nor the users shell setting.
Users tell me that kind of stuff all the time. My cynicism is leaking out again. But it is true that the various login scripts invoked can vary depending on the login environment. Most commonly that's due to internal/external (in other words, spawning sub-shells) and interactive/non-interactive.
Tim Holloway wrote:
Users tell me that kind of stuff all the time.
Users with more than 10 000 posts should know how important accurate information is, when asking for help, and if they provide this detailed information on their own, my experience is, it is mostly right.
I would have tried the commands myself, but of course, nowadays, nobody uses telnet any more, except firmware-stuff, embedded devices, etc.