SSH automatically login with su


Recommended Posts

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 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
  On 04/09/2014 at 16:38, Jack Unterweger said:

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?

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.

  On 04/09/2014 at 16:42, thatguyandrew1992 said:

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

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

  On 04/09/2014 at 16:53, thatguyandrew1992 said:

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.
  On 04/09/2014 at 17:04, Max Norris said:

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 :)

  On 04/09/2014 at 16:53, thatguyandrew1992 said:

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...

  On 04/09/2014 at 17:43, Jack Unterweger said:

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

  On 04/09/2014 at 18:10, thatguyandrew1992 said:

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.

  On 04/09/2014 at 18:59, thatguyandrew1992 said:

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 :)

Set marked as solved for .

 

https://www.neowin.net/forum/topic/1228487-ssh-automatically-login-with-su/?view=findpost&p=596567405

 

 

  On 04/09/2014 at 18:59, thatguyandrew1992 said:

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Basically, they can hire someone with less skill for a lower wage, for example from India, and use AI to bring that employees output up to the level of someone more experienced and expensive. It’s a broad cost-cutting strategy, and plenty of companies are already doing it. With AI involved, the employee just needs to check that the AI's results aren’t complete junk. They don’t actually have to know how to produce the work themselves. You just get one high level employee to triple check who does. The workflow looks like this: AI generates the content, a low-skilled worker filters out anything clearly broken or wrong, and a high-skilled worker gives it a final pass. Instead of hiring a full team of experts, companies can rely on a few at the top while AI and cheaper labour handle the bulk of the process.
    • Aah, always the evil terrorist group. Why not just the Russians, they're worse than any terrorist organisation.
    • LG Electronics sees profit dip but boosts shareholder returns by Paul Hill LG Electronics (LGE) has reported consolidated sales of 20.74 trillion Korean Won (approximately $15.14 billion USD) and an operating profit of 639.4 billion Korean Won (approximately $466.75 million USD) for the second quarter of 2025. The firm saw both its revenue and operating profits decline year-over-year due to external factors such as US tariff policies, ongoing geopolitical issues in the Middle East, and a slowdown in consumer spending. While the company has faced challenges, the company is aiming for what it called qualitative growth by strengthening its subscription services, direct online sales, and business-to-business (B2B) segments. Key areas of growth for LGE include automotive electronics, heating, ventilation, and air conditioning (HVAC) systems, and the webOS platform. The US tariffs are a major headache for companies around the world, given the size of the market there and President Trump's demands for bringing manufacturing to the States. To combat the rising US tariffs, LGE is trying to optimize global production and refine its market-specific approaches for premium and mass-market products. While the company’s profits dipped, it announced an interim dividend of 500 Korean Won (approximately $0.37 USD) per share for both common and preferred, with another payout later in the year that should take the total for 2025 to at least 1,000 Korean Won (approximately $0.73 USD). You must be holding the stock on August 8, 2025, to get the payout on August 22, 2025. The firm also said it will cancel 761,427 common treasury shares on July 31, 2025, making shares more scarce which could increase the value of remaining shares for investors. In terms of LGE’s various business divisions, things were mixed. Its Home Appliance Solution (HS) business achieved year-over-year sales growth, maintaining profitability, thanks to a dual strategy for premium and volume segments and growth in online sales and subscriptions. Its Media Entertainment Solution (MS) business experienced declines in sales and operating profits with the latter turning negative due to market uncertainties and stiff competition. Its Vehicle Solution (VS) business showed growth in sales and operating profit thanks to increased orders from European automotive makers. Finally, its Eco Solution (ES) business saw domestic sales increase, but overseas sales growth was limited due to US tariffs. This led to a slight year-over-year drop in operating profit due to higher costs. Image via Depositphotos.com
    • "Microsoft plans to remove the MSN feed..." Yaaay, finally the horrible dumpster fire of badly translated tabloid trash is going away! Good riddance! "...and replace it with Copilot Discover..." Oh ffs...
    • Similar to how Nvidia stopped caring about the consumer market a while ago and now just pays lip service to it because it prints money.
  • Recent Achievements

    • Week One Done
      Itbob513626 earned a badge
      Week One Done
    • One Month Later
      Itbob513626 earned a badge
      One Month Later
    • Rookie
      EdwardFranciscoVilla went up a rank
      Rookie
    • Week One Done
      MoJo624 earned a badge
      Week One Done
    • Collaborator
      aeganwn earned a badge
      Collaborator
  • Popular Contributors

    1. 1
      +primortal
      618
    2. 2
      ATLien_0
      243
    3. 3
      Xenon
      159
    4. 4
      Michael Scrip
      126
    5. 5
      +FloatingFatMan
      122
  • Tell a friend

    Love Neowin? Tell a friend!