On Mon, July 6, 2015 15:47, m.roth at 5-cent.us wrote:> James B. Byrne wrote: >> We have a requirement to allow ssh access to a server in order to >> provide a secure link to one of our legacy systems. I would like to >> chroot these accounts. >> >> I have this working except for one small detail, the user's prompt >> in >> the ssh session. Each user has their shell set to /bin/bash in >> /etc/passwd. However, instead of getting the prompt defined in >> their >> .bash_profiles we see this: >> >> -bash-4.1$ >> >> when we are expecting this: >> >> [username at hostname dir]$ >> >> So, before I go messing around moving files I would some information >> from you as tio what I have overlooked. Do I need to move something >> like etc/passwd and /etc/group into the chroot/etc? > > When ssh'ing into the chrooted directories, where's their > /home/<user>? > I'd set the prompt in ~/.bash_profile. > > mark > >It appears that the user profile .bash_profile is not being called at all which no doubt is the root problem. Any ideas as to why this is not happening? Is the -l switch for bash not being used for some reason? -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
James B. Byrne wrote:> > On Mon, July 6, 2015 15:47, m.roth at 5-cent.us wrote: >> James B. Byrne wrote: >>> We have a requirement to allow ssh access to a server in order to >>> provide a secure link to one of our legacy systems. I would like to >>> chroot these accounts. >>> >>> I have this working except for one small detail, the user's prompt >>> in the ssh session. Each user has their shell set to /bin/bash in >>> /etc/passwd. However, instead of getting the prompt defined in >>> their.bash_profiles we see this: >>> >>> -bash-4.1$ >>> >>> when we are expecting this: >>> >>> [username at hostname dir]$ >>> >>> So, before I go messing around moving files I would some information >>> from you as tio what I have overlooked. Do I need to move something >>> like etc/passwd and /etc/group into the chroot/etc? >> >> When ssh'ing into the chrooted directories, where's their >> /home/<user>? >> I'd set the prompt in ~/.bash_profile. > > It appears that the user profile .bash_profile is not being called at > all which no doubt is the root problem. Any ideas as to why this is > not happening? Is the -l switch for bash not being used for some > reason? >When logged in, that's what I was asking - *are* they in a home directory, or are they in /? mark