[SOLVED] what profile file is run when a shell is started via ssh
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What you mean by that. When you login via ssh both the files are used. .bashrc located in your home directory takes global definition like umask value (depend on the UID of the user), prompt etc. from /etc/bashrc.
.bash_profile is use to set any user specific environment / variable / path etc.
Thanks terminator. I didn't know the specifics, but you confirmed what I thought. The problem is actually this then:
I have set up ssh on my Windows 7 machine via cygwin and openssh. When I log into localhost, I get the following:
Could not chdir to home directory : No such file or directory
mkdir: cannot create directory `': No such file or directory
could not be created.
Setting HOME to /tmp.
A few google searches seemed to turn up nothing concrete, so I thought I would solve this by added the following to my .bashrc
export HOME=/home/username
cd $HOME
echo "finished"
And as I type this I realize that didn't help because the shell couldn't find my home dir to begin with. Any other ideas per chance?
Your home directory is specified in /etc/passwd and it looks like as follows:
Code:
tester:x:511:511::/home/tester:/bin/bash
Where tester is the username 511 is his uid and gid /home/tester is his home directory and /bin/bash is the default shell used by this user. x mentioned in this line denotes that the password for this user is linked to /etc/shadow (in encrypted form for added security)
Make sure that the user with which you are trying to login has got home directory under /home and has got rwx permission on his home directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.