PDA

View Full Version : SU and SSH not working.. HELP!



dave_kimberley
15th September 2004, 12:11 PM
Hi,

If I try to SSH to my server as root, everything is fine, however if I use any other account, I will be logged in, but then kicked out.

When I try to su - to a user from root, I recieve the below:

su: warning: cannot change directory to /home/tas: Permission denied
su: /bin/bash: Permission denied

The below is also shown within /var/log/secure

Sep 15 12:05:27 tas su: pam_succeed_if: requirement "uid < 100" not met by user "tas"

I am using FC2 with kernel 2.6.8-1.521

Please can some one help, this is driving me mad.. :mad:

superbnerd
15th September 2004, 12:14 PM
did you have problems before 2.6.8. this kernel is known to cause all sort of problems, but it shouldn't affect ssh.

dave_kimberley
15th September 2004, 12:16 PM
I have just completed a fresh install, and everything was working fine. Upto about 1hr ago.

jcstille
15th September 2004, 12:35 PM
what user id are you using?

dave_kimberley
15th September 2004, 12:42 PM
I am root trying to su to tas, a user I have created. However from reviewing log files, any su attempt is not working.

jeru
15th September 2004, 02:02 PM
Maybe a file permission problem?

what does
ll /home
return?

if it is not tas as the owner;

ssh in as root, then try
chown -R tas:tas /home/tas

First error obviously looks like a file permission problem, but the second I think should not be there if it did in fact authenticate as he should still have access to /bin/bash. But it might be worth a look/try?

dave_kimberley
15th September 2004, 05:41 PM
I have changed the permissions on /home/tas, but I still get the below error when I try to su to the user

su: /bin/ksh: Permission denied

I have tried to change the shell within /etc/passwd and still the same error, just with the other shell.

I have also added another user, it seems that this problem occurs with any??

Please, any one seen this before?

dave_kimberley
15th September 2004, 05:45 PM
FIXED!!!!!!

For some strange reason, the /bin directory had 700 permissions?? Back to 755.

Thanks everyone..

aceqbaceq
29th January 2010, 03:51 PM
i've solved today exactly the same problem by adjusting permissions on all folders in root folder

all folder must be 755

and

lost+found = 770
proc = 555
root = 750
tmp =777

SlowJet
30th January 2010, 01:56 PM
I think you use a regular user to ssh to another, then once the connection is made you can su - or sudo according to the user account on the remote machine.

You may be running into the permissions checked before redirection.

SSH via root is very inappropriate and gains you nothing but security issues..

SSHJ

ssh -2 -4 -C -c aes256-cbc -p 22 username@hostname.domainname
username@hostname.domainname's password: <password>
Last login: Day Month dd hh:mm:ss yyyy from somehost.domainname
su -
<rootpassword>
yum clean all --enablerepo=updates-testing
yum update --enablerepo=updates-testing --exclude=tar
lvm lvcreate --size 2G --snapshot --name /dev/VG_HH13/snaproot VolGroup13/snaproot /dev/VG_HH13/LV_HHroot
mount /dev/mapperVG_HH13-snaproot /mnt/snaproot
cd /mnt/bkup
tar -c -f bkuproot710130.tar /mnt/snaproot -P --preserve-permission --preserve-order --one-file-system --xattrs --totals -b32 --exclude=*.iso --exclude=*.vdi
umount /mnt/snaproot
lvm lvremove /dev//mapper/VG_HH13-snaproot
cd /
exit
connection to username@hostname.domainname closed
useryou@youhost $