DrJohnSmitherson Posted September 4, 2014 Share Posted September 4, 2014 How can I make a user on Ubuntu always have su? When I login with ssh or with FTP with an account, I always want that account to have the su privileges. Link to comment Share on other sites More sharing options...
simonlang Posted September 4, 2014 Share Posted September 4, 2014 i think you need to explically activate the su account on ubuntu user-acccount settings. this however is absolutely NOT recommanded and underminse the security concept of linux. Link to comment Share on other sites More sharing options...
Haggis Veteran Posted September 4, 2014 Veteran Share Posted September 4, 2014 I dont understand why you would want to This would be the same as logging in as root which goes against the whole point of having admin and user accounts you can just do ssh user@server and then sudo command Link to comment Share on other sites More sharing options...
DrJohnSmitherson Posted September 4, 2014 Author Share Posted September 4, 2014 i think you need to explically activate the su account on ubuntu user-acccount settings. this however is absolutely NOT recommanded and underminse the security concept of linux. I added the account to the sudoers file, how do I activate it via command line? Link to comment Share on other sites More sharing options...
simonlang Posted September 4, 2014 Share Posted September 4, 2014 or write 2 bash files executing sudo first then the program... Link to comment Share on other sites More sharing options...
Max Norris Posted September 4, 2014 Share Posted September 4, 2014 Under Ubuntu you'd activate the "root" account, which you can do just by giving it a password ("sudo passwd").. but as Haggis recommended, it's not the best idea. (Just another attack surface, sudo will log everything done, etc) You can also use visudo to fine-tune permissions, etc if needed. Link to comment Share on other sites More sharing options...
Haggis Veteran Posted September 4, 2014 Veteran Share Posted September 4, 2014 I added the account to the sudoers file, how do I activate it via command line? so lets say your user is haggis and you added haggis to sudoers file on the server your are SSHing into ssh haggis@server then once logged in do sudo cp /etc/fstab ~/fstab.txt etc Link to comment Share on other sites More sharing options...
DrJohnSmitherson Posted September 4, 2014 Author Share Posted September 4, 2014 I'll provide some more information. This is for a web server. For my old web server (which someone else setup for me) I was given an account. When I login with putty, I just use the IP and port and in the terminal I have user@server:~$: This allows me to hit tab and it will autocomplete with a dir or file etc On my new webserver which I setup myself, I made an account, added it to the sudoers file, but when I login, the same way, which just an IP and port I only have the following in the terminal $ And I can't use tab. How do I make it user@server:~$ ? So far, doing su user is the only way Link to comment Share on other sites More sharing options...
Max Norris Posted September 4, 2014 Share Posted September 4, 2014 On my new webserver which I setup myself, I made an account, added it to the sudoers file, but when I login, the same way, which just an IP and port I only have the following in the terminal $ And I can't use tab. How do I make it user@server:~$ ? So far, doing su user is the only way Sounds like you need to copy over a .bashrc file into that users home directory. That sets up tab completion, the default prompt, all that jazz. Don't need to log in as root for that. Link to comment Share on other sites More sharing options...
DrJohnSmitherson Posted September 4, 2014 Author Share Posted September 4, 2014 Sounds like you need to copy over a .bashrc file into that users home directory. That sets up tab completion, the default prompt, all that jazz. Don't need to log in as root for that. Ah good to know! Thanks :) Link to comment Share on other sites More sharing options...
simonlang Posted September 4, 2014 Share Posted September 4, 2014 I'll provide some more information. This is for a web server. For my old web server (which someone else setup for me) I was given an account. When I login with putty, I just use the IP and port and in the terminal I have user@server:~$: This allows me to hit tab and it will autocomplete with a dir or file etc On my new webserver which I setup myself, I made an account, added it to the sudoers file, but when I login, the same way, which just an IP and port I only have the following in the terminal $ And I can't use tab. How do I make it user@server:~$ ? So far, doing su user is the only way why su user not sudo user? sudo allows using tab for autocomplete.... write a bash file: sudo yourcommand, save it as .sh make it executable and put it in your autostart list... Link to comment Share on other sites More sharing options...
DrJohnSmitherson Posted September 4, 2014 Author Share Posted September 4, 2014 why su user not sudo user? sudo allows using tab for autocomplete.... write a bash file: sudo yourcommand, save it as .sh make it executable and put it in your autostart list... I'm not this familiar with linux, but I will look into it Link to comment Share on other sites More sharing options...
simonlang Posted September 4, 2014 Share Posted September 4, 2014 I'm not this familiar with linux, but I will look into it sudo yourprogram save this as ./run123.sh chmod it to +777 and just add an autostart entry (if you got a KDE based distro i can give you screenshots where to find it). with kde it's easy, as you can either use sudo, kdesudo or gksudo to run that sh file. Link to comment Share on other sites More sharing options...
DrJohnSmitherson Posted September 4, 2014 Author Share Posted September 4, 2014 I think I solved it. I went into the passwd file and added /bin/bash to my user. :D Now I have what I was trying to accomplish :D Brandon H 1 Share Link to comment Share on other sites More sharing options...
Brandon H Supervisor Posted September 4, 2014 Supervisor Share Posted September 4, 2014 I think I solved it. I went into the passwd file and added /bin/bash to my user. :D Now I have what I was trying to accomplish :D gotta love when it's just something simple that was overlooked :) Link to comment Share on other sites More sharing options...
LittleNeutrino Veteran Posted September 4, 2014 Veteran Share Posted September 4, 2014 Set marked as solved for . https://www.neowin.net/forum/topic/1228487-ssh-automatically-login-with-su/?view=findpost&p=596567405 I think I solved it. I went into the passwd file and added /bin/bash to my user. :D Now I have what I was trying to accomplish :D Link to comment Share on other sites More sharing options...
Recommended Posts