Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Tweeted twitter.com/StackUnix/status/650160508184752128
4 Update
source | link

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

After that I deleted and reecreated the group, still couldn't login. Then I changed the user and test account to a different group and it worked fine.

....so I guess this is solved, but what the heck went on there?

Update

Alright, so I was back at it today. Used pretty much the same instructions after giving everything a nice clean slate. Created the environment using the make_chroot_jail.sh script. Altered the /etc/ssh/sshd_config so that it it would chroot to the chroot folder.

Folder Scheme: /home/chroot/{bin,dev,etc,home,lib,lib64,sbin,usr}

I've also confirmed that the dev folder contains the tty character device, and in addition, I learned that the pts items couldn't be called normally becuase they weren't really files or something. In any case, followed that lead, and restarted the service and instead of the original error I then got the following.

: error: /dev/pts/1: Permission denied
: error: open /dev/tty failed - could not set controlling tty: Permission denied

Time's up today though, I'm going to try freeing up the permissions on the two files but that sorta defeats part of the purpose of doing the chroot.

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

After that I deleted and reecreated the group, still couldn't login. Then I changed the user and test account to a different group and it worked fine.

....so I guess this is solved, but what the heck went on there?

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

After that I deleted and reecreated the group, still couldn't login. Then I changed the user and test account to a different group and it worked fine.

....so I guess this is solved, but what the heck went on there?

Update

Alright, so I was back at it today. Used pretty much the same instructions after giving everything a nice clean slate. Created the environment using the make_chroot_jail.sh script. Altered the /etc/ssh/sshd_config so that it it would chroot to the chroot folder.

Folder Scheme: /home/chroot/{bin,dev,etc,home,lib,lib64,sbin,usr}

I've also confirmed that the dev folder contains the tty character device, and in addition, I learned that the pts items couldn't be called normally becuase they weren't really files or something. In any case, followed that lead, and restarted the service and instead of the original error I then got the following.

: error: /dev/pts/1: Permission denied
: error: open /dev/tty failed - could not set controlling tty: Permission denied

Time's up today though, I'm going to try freeing up the permissions on the two files but that sorta defeats part of the purpose of doing the chroot.

3 added 222 characters in body
source | link

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

After that I deleted and reecreated the group, still couldn't login. Then I changed the user and test account to a different group and it worked fine.

....so I guess this is solved, but what the heck went on there?

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

After that I deleted and reecreated the group, still couldn't login. Then I changed the user and test account to a different group and it worked fine.

....so I guess this is solved, but what the heck went on there?

2 added 87 characters in body
source | link

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I've also added another user and been able to login successfully so this is just completely baffling me, and I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I've also added another user and been able to login successfully so this is just completely baffling me, and I'm completely lost at this point. Any insight would be appreciated.

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux.

Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in with that user. I checked /var/log/secure to see if that could shed any light on it, and I got the following.

: Address aaa.bbb.ccc.ddd maps to "A_Certain_Computer"
: Accepted password for student.fesns from aaa.bbb.ccc.ddd port ##### ssh2
: pam_unix(sshd:session): session opened for user student.fesns by (uid=0)
: error: /dev/pts/2: No such file or directory
: error: open /dev/tty failed - could not set controlling tty: No such file or directory
: pam_unix(sshd:session): session closed for user student.fesns

I checked both the files, and they do actually exist. I then attempted to reverted the changes I made to try and chroot the user, so the home directory is back to /home/User, and the startup script is set ot /bin/bash, and I've removed the section of code in /etc/ssh/sshd_config to revert it back to its original settings.

I'm completely lost at this point. Any insight would be appreciated.

New Informatoin I've also added another user and been able to login successfully. I then changed its group to the group of the first user, and then it did the same thing as the first one.

1
source | link