SSH - Password Protected Directory Issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SSH - Password Protected Directory Issue
# 1  
Old 06-12-2012
SSH - Password Protected Directory Issue

I dug myself a hole yesterday that I can't seem to get myself out of.

In a very futile attempt to create a new FTP user with limited access via SSH, I inadvertently changed permissions for who knows what and now I am having a problem accessing password protected directories. When I enter the correct credentials, the log-in prompt keeps coming up each time I click the "OK" button.

I'm sure a lot more information is required to assist me with this problem, but being a newbie, I'm not sure where to begin.

Below is the bash history of what I did, but if anyone can lend a hand, just let me know what information is required in order to help me reverse the problem.

Thanks in advance!

Code:
  id root
  ndn
  user ndn
  id ndn
  /usr/sbin/useradd -u 10076 -o -d /var/www/vhosts/mysite.com/custom_folder -g psacln -s /bin/false/ diva
  rockinrobin diva
  passwd diva
  id diva
  id ndn
  id ndn
  /usr/sbin/useradd -u 10076 -o -d /var/www/vhosts/mysite.com -g psacln -s /bin/false diva
  passwd diva
  useradd diva
  groupadd diva
  gpasswd -a diva diva
  chgrp -R groupnam /var/www/vhosts/mysite.com
  chgrp -R diva /var/www/vhosts/mysite.com
  chmod -R g+rw /var/www/vhosts/mysite.com
  chgrp -R root /var/www/vhosts/mysite.com
  chmod -R g+rw /var/www/vhosts/mysite.com
  sudo deluser diva
  chgrp -R owner /var/www/vhosts/mysite.com
  chown user:root /var/www/vhosts/mysite.com
  chown root /var/www/vhosts/mysite.com
  chown -R root *
  deluser diva
  groupdel diva
  userdel diva
  id diva
  chmod -R g-rw /var/www/vhosts/mysite.com
  chgrp -R root /var/www/vhosts/mysite.com
  chmod +R g+rw /var/www/vhosts/mysite.com
  chmod g+rw /var/www/vhosts/mysite.com
  chmod -R g-rw /var/www/vhosts/mysite.com
  id root
  chgrp -R root /var/www/vhosts/mysite.com
  chmod -R g-rw /var/www/vhosts/mysite.com
  chmod 2775 /var/www/vhosts/mysite.com
  chown root:root /var/www/vhosts/mysite.com
  chmod -R g-rw/var/www/vhosts/mysite.com
  chmod -R g-rw /var/www/vhosts/mysite.com
  chmod 2775 /var/www/vhosts/mysite.com
  ls -l
  chmod -R g+r /var/www/vhosts/mysite.com
  ls -alh
  cd mysite.com


Last edited by pludi; 06-12-2012 at 11:33 AM..
# 2  
Old 06-12-2012
this isn't particularly easy to follow. perhaps the output of ls -alh /var/www/vhosts/mysite.com. but likely you mean accessing folders via web-server, which sees .htpasswd but cannot read it. ensure the user/group which runs your httpd has permission to read it. sometimes this is user 'apache' or 'www-data'

edit: seems you changed to root:root, but only used recursive for the group, which you set g+r.. same with the 2755, wasn't done recursively (i believe new files would inherit group, but not your old ones). but probably your webserver isn't ran a root, i hope. so probably chgrp -R to correct group for webserver.

Last edited by neutronscott; 06-12-2012 at 11:36 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Make a password protected bash script resist/refuse “bash -x” when the password is given

I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored. The code: read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
Discussion started by: frad
7 Replies

2. SuSE

SSH issue - can't get password less login to work

Hello, I can't seem to get the password less login to work on one of my SLES 11 servers. My ssh agent lets me login to all my other servers, which are Solaris 10, RHEL 5, and SLES 11 servers. Some servers mount my home directory and others don't. The server that I'm having an issue with doesn't... (7 Replies)
Discussion started by: bitlord
7 Replies

3. Cybersecurity

SSH password-less login issue between linux and solaris

Hello Gurus, I am trying to set up bidirectional password-less login between a linux and a Solaris. The way I am doing is very simple, which is creating pub/priv key pairs on each host and add the pub key to each other's authorized_keys file: ssh-keygen -t rsa (I tried dsa, and it didn't work... (4 Replies)
Discussion started by: error_lee
4 Replies

4. Emergency UNIX and Linux Support

SSH password login issue

Hi All, I am facing issue in setting up passwordless login through ssh on two Solaris-10 boxes. user-id ravrwa from server tsapiq04-zrwdq01 should be able to login to server tsbrit03 as cpsuserq, which is not happening. I am not sure where is the problem, while keys are already all set. Here is... (14 Replies)
Discussion started by: solaris_1977
14 Replies

5. UNIX for Dummies Questions & Answers

Unzipping multiple password-protected files

I am trying to unzip ~150 files on a SUN server in Unix via a telnet program (PuTTy), so I am restricted (I believe) to single-line command functions. All of the files are password protected, and each one contains three files. Is there a way to automate the process? I have tried 7z, but that only... (0 Replies)
Discussion started by: Davman
0 Replies

6. Shell Programming and Scripting

Unzipping files <password protected>

Hie Friends, I need your help once again. I have 77 “password protected” winzip files in linux/unix server. I want to decrypt it through an automated script. Password of every file is same and it is mhd*tt. Please help me. Usually I unzip it as follows, manually one by one. unzip <file name> ... (6 Replies)
Discussion started by: anushree.a
6 Replies

7. Shell Programming and Scripting

How to make files/folders Password protected

Any idea how to make files/folders password protected... I dont want to change the permissions of the files/folders... (1 Reply)
Discussion started by: know d unknown
1 Replies

8. Shell Programming and Scripting

How to make script password protected

Hi All, I want to make my script password protected. i e: if somebody runs my script it should prompt for password. Can somebody help me in to execute the same?? Thanks in Advance :b: (11 Replies)
Discussion started by: achararun
11 Replies

9. UNIX for Dummies Questions & Answers

Print on a printer which is password protected

Hi, I am trying to print from HP unix machine to a Toshiba printer which is password protected. How can I print? Thanks. Anuj (1 Reply)
Discussion started by: Anuj
1 Replies

10. Cybersecurity

Creating a Password-Protected directory for ftp Uploads & Downloads

Hello All! Am new here; please excuse any blunders! Am dealing with an off-site ISP UNIX server on which no Telnet access and no Anonymous FTP access is allowed, and which is hosting a client web site. Need to create a separate area within that site to hold occasional outside ftp uploads... (3 Replies)
Discussion started by: NAL
3 Replies
Login or Register to Ask a Question