LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-14-2013, 11:04 AM   #1
redhat19
Member
 
Registered: Jan 2012
Posts: 45

Rep: Reputation: Disabled
How can I grant an already created user shell access?


Hi Guys,
Our server runs CentOS 6 here. I had created a user with the following command:
Code:
[root@myserver1 ~]# useradd -c "myApp FTP User" -s /bin/false -d /var/www/vhosts/myapp/httpdocs ftp.myapp
Now, it turns out that the (FTP) user I had created, ftp.myapp now requires shell access.
I have attempted to grant the user shell access by editing the sshd_config file (which is located here /etc/ssh/sshd_config)
I added these line to the file:
AllowUsers myApp
But when I try to login as this user via SSH (I use putty), after inserting the username and password on the command prompt, the screen exits.
What am I missing here?
I would appreciate any useful input/suggestions.
Thanks.
 
Old 08-14-2013, 11:12 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redhat19 View Post
Hi Guys,
Our server runs CentOS 6 here. I had created a user with the following command:
Code:
[root@myserver1 ~]# useradd -c "myApp FTP User" -s /bin/false -d /var/www/vhosts/myapp/httpdocs ftp.myapp
Now, it turns out that the (FTP) user I had created, ftp.myapp now requires shell access. I have attempted to grant the user shell access by editing the sshd_config file (which is located here /etc/ssh/sshd_config)
I added these line to the file:
AllowUsers myApp
But when I try to login as this user via SSH (I use putty), after inserting the username and password on the command prompt, the screen exits. What am I missing here?
You don't have to edit anything with SSH, but the user you created above has the problem on the line you posted. Read the man page on useradd, and pay particular attention to the "-s" flag. You've specified the users shell to be /bin/false (i.e. NO login shell). So, modify the user with the usermod command, as "usermod -s /bin/bash <username>".
 
2 members found this post helpful.
Old 08-14-2013, 11:13 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
lol, much better answer than mine!

Last edited by TenTenths; 08-14-2013 at 11:14 AM. Reason: Meh, beaten to it! :)
 
Old 08-14-2013, 12:02 PM   #4
redhat19
Member
 
Registered: Jan 2012
Posts: 45

Original Poster
Rep: Reputation: Disabled
Thanks a million.
That just solved it.
its working now.

Regards,
 
Old 08-15-2013, 03:12 PM   #5
redhat19
Member
 
Registered: Jan 2012
Posts: 45

Original Poster
Rep: Reputation: Disabled
It turns out that I need to grant this user root privileges or sudo rights for some of the admin work the user wants to carry out.
How can I achieve this?

Thanks.
 
Old 08-15-2013, 03:32 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redhat19 View Post
It turns out that I need to grant this user root privileges or sudo rights for some of the admin work the user wants to carry out.
How can I achieve this?
You add the user into the sudoers file, or give them the root password. There are many tutorials you can find on how to configure sudo/sudoers.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to grant root level access to simple admin user njb Linux Mint 4 08-03-2012 12:09 PM
Grant normal user to run certain script with root access cdestiny Linux - Server 4 09-30-2008 02:42 AM
Howto grant access for a user to qtparted? powadha Debian 2 06-17-2005 03:18 AM
grant user access to /fat-c & copying users' preferences to another user n0x Linux - Newbie 1 07-04-2004 12:04 AM
grant a user access to /fat-c n0x Slackware 4 05-02-2004 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration